mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
Don't use start after freeing it in thread startup code.
svn path=/trunk/thread/; revision=3264
This commit is contained in:
parent
d4d6716a52
commit
3379751e19
@ -574,6 +574,7 @@ static void *_start_routine(void *arg)
|
|||||||
void *(*start_routine)(void *) = start->start_routine;
|
void *(*start_routine)(void *) = start->start_routine;
|
||||||
void *real_arg = start->arg;
|
void *real_arg = start->arg;
|
||||||
thread_t *thread = start->thread;
|
thread_t *thread = start->thread;
|
||||||
|
int detach = start->detached;
|
||||||
|
|
||||||
_block_signals();
|
_block_signals();
|
||||||
|
|
||||||
@ -587,7 +588,7 @@ static void *_start_routine(void *arg)
|
|||||||
|
|
||||||
LOG_INFO4("Added thread %d [%s] started at [%s:%d]", thread->thread_id, thread->name, thread->file, thread->line);
|
LOG_INFO4("Added thread %d [%s] started at [%s:%d]", thread->thread_id, thread->name, thread->file, thread->line);
|
||||||
|
|
||||||
if (start->detached) {
|
if (detach) {
|
||||||
pthread_detach(thread->sys_thread);
|
pthread_detach(thread->sys_thread);
|
||||||
}
|
}
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user