diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-10 20:38:59 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-10 20:38:59 +0000 |
commit | d65a5a061e703b5cc566acde1aef62a7a777a405 (patch) | |
tree | 3b7bb54f27e7071dfc8c67cfae8f6ea4d3940120 /channels/chan_mgcp.c | |
parent | 4416abd9601b2a1deabeaacb98d04ac2b259d767 (diff) |
don't create monitor threads in detached mode, when we need to be able to pthread_join() them later if the module is unloaded (solve crash-on-unload problem for these channel modules)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@9404 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 4447bd7ff..d3b68e226 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -1,7 +1,7 @@ /* * Asterisk -- An open source telephony toolkit. * - * Copyright (C) 1999 - 2005, Digium, Inc. + * Copyright (C) 1999 - 2006, Digium, Inc. * * Mark Spencer <markster@digium.com> * @@ -3469,10 +3469,6 @@ static void *do_monitor(void *data) static int restart_monitor(void) { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - /* If we're supposed to be stopped -- stay stopped */ if (monitor_thread == AST_PTHREADT_STOP) return 0; @@ -3490,7 +3486,7 @@ static int restart_monitor(void) pthread_kill(monitor_thread, SIGURG); } else { /* Start a new monitor */ - if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) { + if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) { ast_mutex_unlock(&monlock); ast_log(LOG_ERROR, "Unable to start monitor thread.\n"); return -1; |