diff options
-rw-r--r-- | channels/chan_h323.c | 5 | ||||
-rw-r--r-- | channels/chan_skinny.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index cd6ca8e5f..13526b9e5 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -2604,7 +2604,7 @@ static int restart_monitor(void) pthread_kill(monitor_thread, SIGURG); } else { /* 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; ast_mutex_unlock(&monlock); ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); @@ -3320,8 +3320,7 @@ static int unload_module(void) pthread_cancel(monitor_thread); } pthread_kill(monitor_thread, SIGURG); - /* Cannot join detached threads */ - /* pthread_join(monitor_thread, NULL); */ + pthread_join(monitor_thread, NULL); } monitor_thread = AST_PTHREADT_STOP; ast_mutex_unlock(&monlock); diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 3c0c9fbfc..8b06980c1 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -5917,7 +5917,7 @@ static void *accept_thread(void *ignore) AST_LIST_INSERT_HEAD(&sessions, s, list); 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); } } |