summaryrefslogtreecommitdiff
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-05-04 20:02:30 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2011-05-04 20:02:30 +0200
commit89ae6ab2a2cfece70bf55c2a314376093e6a1a41 (patch)
tree7695c65229b5132eecc4c4f7105ee249792fe832 /Python/thread_pthread.h
parent937d0116fec9486da27788e281287878396742be (diff)
downloadcpython-89ae6ab2a2cfece70bf55c2a314376093e6a1a41.tar.gz
Issue #1856: Avoid crashes and lockups when daemon threads run while the
interpreter is shutting down; instead, these threads are now killed when they try to take the GIL.
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index ffc791c578..6bc9d55781 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -250,9 +250,9 @@ void
PyThread_exit_thread(void)
{
dprintf(("PyThread_exit_thread called\n"));
- if (!initialized) {
+ if (!initialized)
exit(0);
- }
+ pthread_exit(0);
}
#ifdef USE_SEMAPHORES