aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_h323.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 18:30:19 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 18:30:19 +0000
commita42bc96f14e6c4c6c8fe8e7c743df555036e885b (patch)
tree86895556d8f221a39105f4398a54d612fbbd3da8 /channels/chan_h323.c
parentf97bf5fd4d30bd179aac274961e7695ddc60e165 (diff)
Add a new API call for creating detached threads. Then, go replace all of the
places in the code where the same block of code for creating detached threads was replicated. (patch from bbryant) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@65968 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r--channels/chan_h323.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 65154b618..e8d091528 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -2601,7 +2601,6 @@ restartsearch:
static int restart_monitor(void)
{
- pthread_attr_t attr;
/* If we're supposed to be stopped -- stay stopped */
if (ast_mutex_lock(&monlock)) {
ast_log(LOG_WARNING, "Unable to lock monitor\n");
@@ -2620,17 +2619,13 @@ 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_background(&monitor_thread, &attr, do_monitor, NULL) < 0) {
+ if (ast_pthread_create_detached_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");
- pthread_attr_destroy(&attr);
return -1;
}
- pthread_attr_destroy(&attr);
}
ast_mutex_unlock(&monlock);
return 0;