diff options
Diffstat (limited to 'sysdeps/mach/pt-thread-start.c')
-rw-r--r-- | sysdeps/mach/pt-thread-start.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/mach/pt-thread-start.c b/sysdeps/mach/pt-thread-start.c index 11b017f..df490ab 100644 --- a/sysdeps/mach/pt-thread-start.c +++ b/sysdeps/mach/pt-thread-start.c @@ -27,9 +27,10 @@ int __pthread_thread_start (struct __pthread *thread) { + static int do_start; error_t err; - if (__pthread_num_threads == 1) + if (! do_start) { /* The main thread is already running: do nothing. */ assert (__pthread_total == 1); @@ -38,6 +39,7 @@ __pthread_thread_start (struct __pthread *thread) __mach_port_deallocate (__mach_task_self (), thread->kernel_thread); ok; })); + do_start = 1; } else { |