summaryrefslogtreecommitdiffstats
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index c83cd2d..0e2ca11 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -98,6 +98,8 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
init_thread();
success = pthread_create(&th, pthread_attr_default,
(void* (*) _P((void *)))func, arg);
+ if (success >= 0)
+ pthread_detach(th);
return success < 0 ? 0 : 1;
}