Commit be4329b3 authored by Guido van Rossum's avatar Guido van Rossum

Add detach call so threads are GC'ed.

parent e1f93f41
...@@ -98,6 +98,8 @@ int start_new_thread _P2(func, void (*func) _P((void *)), arg, void *arg) ...@@ -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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment