diff Python/thread_pthread.h @ 69832:2a19d09b08f8 3.2

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.
author Antoine Pitrou <solipsis@pitrou.net>
date Wed, 04 May 2011 20:02:30 +0200
parents 54edabf2846d
children 8a484090da7e c892b0321d23
line wrap: on
line diff
--- a/Python/thread_pthread.h	Wed May 04 18:39:29 2011 +0300
+++ b/Python/thread_pthread.h	Wed May 04 20:02:30 2011 +0200
@@ -250,9 +250,9 @@
 PyThread_exit_thread(void)
 {
     dprintf(("PyThread_exit_thread called\n"));
-    if (!initialized) {
+    if (!initialized)
         exit(0);
-    }
+    pthread_exit(0);
 }
 
 #ifdef USE_SEMAPHORES