diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-24 20:52:27 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-24 20:52:27 +0200 |
| commit | 37cbd069c30e77278338b265655b9d9b37278fcd (patch) | |
| tree | 455bf7fcbdd0dc200704d6a2799697c72f4ecc09 /Python/thread_pthread.h | |
| parent | 092d337edf45e768e561862bee44cd67a526501b (diff) | |
| download | cpython-37cbd069c30e77278338b265655b9d9b37278fcd.tar.gz | |
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 09a0887bd4..fe9dde6f52 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) { |
