Recorded merge of revisions 154263 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r154263 | tilghman | 2008-11-04 12:58:05 -0600 (Tue, 04 Nov 2008) | 3 lines Make the monitor thread non-detached, so it can be joined (suggested by Russell on -dev list). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
2cc8e25222
commit
721b90aa4b
|
@ -2604,7 +2604,7 @@ static int restart_monitor(void)
|
||||||
pthread_kill(monitor_thread, SIGURG);
|
pthread_kill(monitor_thread, SIGURG);
|
||||||
} else {
|
} else {
|
||||||
/* Start a new monitor */
|
/* Start a new monitor */
|
||||||
if (ast_pthread_create_detached_background(&monitor_thread, NULL, do_monitor, NULL) < 0) {
|
if (ast_pthread_create_background(&monitor_thread, NULL, do_monitor, NULL) < 0) {
|
||||||
monitor_thread = AST_PTHREADT_NULL;
|
monitor_thread = AST_PTHREADT_NULL;
|
||||||
ast_mutex_unlock(&monlock);
|
ast_mutex_unlock(&monlock);
|
||||||
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
|
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
|
||||||
|
@ -3320,8 +3320,7 @@ static int unload_module(void)
|
||||||
pthread_cancel(monitor_thread);
|
pthread_cancel(monitor_thread);
|
||||||
}
|
}
|
||||||
pthread_kill(monitor_thread, SIGURG);
|
pthread_kill(monitor_thread, SIGURG);
|
||||||
/* Cannot join detached threads */
|
pthread_join(monitor_thread, NULL);
|
||||||
/* pthread_join(monitor_thread, NULL); */
|
|
||||||
}
|
}
|
||||||
monitor_thread = AST_PTHREADT_STOP;
|
monitor_thread = AST_PTHREADT_STOP;
|
||||||
ast_mutex_unlock(&monlock);
|
ast_mutex_unlock(&monlock);
|
||||||
|
|
|
@ -5917,7 +5917,7 @@ static void *accept_thread(void *ignore)
|
||||||
AST_LIST_INSERT_HEAD(&sessions, s, list);
|
AST_LIST_INSERT_HEAD(&sessions, s, list);
|
||||||
AST_LIST_UNLOCK(&sessions);
|
AST_LIST_UNLOCK(&sessions);
|
||||||
|
|
||||||
if (ast_pthread_create_detached(&s->t, NULL, skinny_session, s)) {
|
if (ast_pthread_create(&s->t, NULL, skinny_session, s)) {
|
||||||
destroy_session(s);
|
destroy_session(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue