From: Guido van Rossum Date: Wed, 30 Apr 1997 19:59:22 +0000 (+0000) Subject: Add detach call so threads are GC'ed. X-Git-Tag: v1.5a1~81 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4806c2a85dccb94a183b584f99b6b5b8f40e6db;p=python Add detach call so threads are GC'ed. --- diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index c83cd2d8a1..0e2ca11b38 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; }