avoid crashes and lockups from daemon threads during interpreter shutdown (#1856)
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index c9ed796..0c1fdfe 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -242,9 +242,9 @@
 PyThread_exit_thread(void)
 {
     dprintf(("PyThread_exit_thread called\n"));
-    if (!initialized) {
+    if (!initialized)
         exit(0);
-    }
+    pthread_exit(0);
 }
 
 #ifdef USE_SEMAPHORES