mirror of https://github.com/python/cpython
Add detach call so threads are GC'ed.
This commit is contained in:
parent
03ef647847
commit
f4806c2a85
|
@ -98,6 +98,8 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg)
|
||||||
init_thread();
|
init_thread();
|
||||||
success = pthread_create(&th, pthread_attr_default,
|
success = pthread_create(&th, pthread_attr_default,
|
||||||
(void* (*) _P((void *)))func, arg);
|
(void* (*) _P((void *)))func, arg);
|
||||||
|
if (success >= 0)
|
||||||
|
pthread_detach(th);
|
||||||
return success < 0 ? 0 : 1;
|
return success < 0 ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue