diff Python/thread_pthread.h @ 70943:024827a9db64

Issue #12392: fix thread initialization on FreeBSD 6 On FreeBSD6, pthread_kill() doesn't work on the main thread before the creation of the first thread. Create therefore a dummy thread (no-op) a startup to initialize the pthread library. Add also a test for this use case, test written by Charles-François Natali.
author Victor Stinner <victor.stinner@haypocalc.com>
date Fri, 24 Jun 2011 20:52:27 +0200
parents 8220f68f1229
children 34061f0d35ba
line wrap: on
line diff
--- a/Python/thread_pthread.h	Fri Jun 24 13:28:08 2011 -0400
+++ b/Python/thread_pthread.h	Fri Jun 24 20:52:27 2011 +0200
@@ -144,7 +144,10 @@
  * Initialization.
  */
 
-#ifdef _HAVE_BSDI
+/* On FreeBSD6, pthread_kill() doesn't work on the main thread before
+   the creation of the first thread */
+#if defined(_HAVE_BSDI) \
+    || (defined(__FreeBSD__) && __FreeBSD_version < 700000)
 static
 void _noop(void)
 {