From e71db4450cc3ede22dbfda7c7eb9149cf685650f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 24 Jun 2011 20:52:27 +0200 Subject: Issue #12392: fix thread initialization on FreeBSD 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Python/thread_pthread.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Python/thread_pthread.h') 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) { -- cgit v1.2.1