mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Add detach call so threads are GC'ed.
This commit is contained in:
parent
03ef647847
commit
f4806c2a85
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue