diff options
author | Guido van Rossum <guido@python.org> | 1997-04-30 19:59:22 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-04-30 19:59:22 (GMT) |
commit | f4806c2a85dccb94a183b584f99b6b5b8f40e6db (patch) | |
tree | ae5ea399a61f479aaa5c967a3ffc2b18907f5196 /Python | |
parent | 03ef6478476c284d3e60d81150610f44290b8d79 (diff) | |
download | cpython-f4806c2a85dccb94a183b584f99b6b5b8f40e6db.zip cpython-f4806c2a85dccb94a183b584f99b6b5b8f40e6db.tar.gz cpython-f4806c2a85dccb94a183b584f99b6b5b8f40e6db.tar.bz2 |
Add detach call so threads are GC'ed.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/thread_pthread.h | 2 |
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; } |