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.
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index ffc791c..6bc9d55 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -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