aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-24 20:52:27 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-24 20:52:27 +0200
commite71db4450cc3ede22dbfda7c7eb9149cf685650f (patch)
treed80ee8458e5681f6584f9f2ac7f479dbcf6ee1f9 /Python/thread_pthread.h
parentMerge #10206: add test for previously fixed bug. (diff)
downloadcpython-e71db4450cc3ede22dbfda7c7eb9149cf685650f.tar.gz
cpython-e71db4450cc3ede22dbfda7c7eb9149cf685650f.tar.bz2
cpython-e71db4450cc3ede22dbfda7c7eb9149cf685650f.zip
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.
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 09a0887bd45..fe9dde6f521 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -144,7 +144,10 @@ typedef struct {
* 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)
{