libroot: spawn_thread() now creates a detached pthread.

* __pthread_destroy_thread() will in turn free the pthread_thread object.
* this fixes a leak of 2072 bytes on each thread construction/destruction
and #9945. MediaExtractor spawns a thread on construction, which leaked
its pthread_thread object on destuction.
This commit is contained in:
Jérôme Duval 2013-09-26 21:19:11 +02:00
parent 53e2862144
commit 1bc85a38d5

View File

@ -110,6 +110,7 @@ spawn_thread(thread_func entry, const char *name, int32 priority, void *data)
__pthread_init_creation_attributes(NULL, thread, &thread_entry, entry,
thread, name, &attributes);
thread->flags |= THREAD_DETACHED;
attributes.priority = priority;
@ -256,4 +257,3 @@ snooze_until(bigtime_t timeout, int timeBase)
{
return _kern_snooze_etc(timeout, timeBase, B_ABSOLUTE_TIMEOUT, NULL);
}