diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-24 18:52:27 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-24 18:52:27 (GMT) |
commit | e71db4450cc3ede22dbfda7c7eb9149cf685650f (patch) | |
tree | d80ee8458e5681f6584f9f2ac7f479dbcf6ee1f9 /Python/thread_pthread.h | |
parent | fcb17e13da46c75f76766f8536d5823563d10f1c (diff) | |
download | cpython-e71db4450cc3ede22dbfda7c7eb9149cf685650f.zip cpython-e71db4450cc3ede22dbfda7c7eb9149cf685650f.tar.gz cpython-e71db4450cc3ede22dbfda7c7eb9149cf685650f.tar.bz2 |
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.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 09a0887..fe9dde6 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) { |