diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-10 21:03:04 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-10 21:03:04 +0000 |
commit | b093da8912c4243011e2614dc560cf7ac6436632 (patch) | |
tree | d84f883af18e3f8bf5b5895a0476ed156fcda32c /channels | |
parent | 659d81c583eb7362f7acbf08c67ea8b5bac2e7a4 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@9422 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_mgcp.c | 8 | ||||
-rw-r--r-- | channels/chan_modem.c | 17 | ||||
-rw-r--r-- | channels/chan_sip.c | 4 |
3 files changed, 11 insertions, 18 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; diff --git a/channels/chan_modem.c b/channels/chan_modem.c index f37a29e12..09adc4733 100644 --- a/channels/chan_modem.c +++ b/channels/chan_modem.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> * @@ -718,16 +718,15 @@ static int restart_monitor() return -1; } if (monitor_thread != AST_PTHREADT_NULL) { - pthread_cancel(monitor_thread); - /* Nudge it a little, as it's probably stuck in select */ pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL); - } - /* Start a new monitor */ - 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; + } else { + /* Start a new monitor */ + 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; + } } ast_mutex_unlock(&monlock); return 0; diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2c45421f5..537ede871 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.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> * @@ -11451,8 +11451,6 @@ static int restart_monitor(void) /* Wake up the thread */ pthread_kill(monitor_thread, SIGURG); } else { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* Start a new monitor */ if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) { ast_mutex_unlock(&monlock); |