thread: Properly clean up meta data of thread if pthread_create() fails
This commit is contained in:
@@ -348,6 +348,8 @@ thread_t *thread_create(thread_main_t main, void *arg)
|
|||||||
{
|
{
|
||||||
DBG1(DBG_LIB, "failed to create thread!");
|
DBG1(DBG_LIB, "failed to create thread!");
|
||||||
this->mutex->lock(this->mutex);
|
this->mutex->lock(this->mutex);
|
||||||
|
this->terminated = TRUE;
|
||||||
|
this->detached_or_joined = TRUE;
|
||||||
thread_destroy(this);
|
thread_destroy(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user