]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Fri, 10 Feb 2006 21:03:04 +0000 (21:03 +0000)
committerAutomerge script <automerge@asterisk.org>
Fri, 10 Feb 2006 21:03:04 +0000 (21:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@9422 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr.c
channels/chan_mgcp.c
channels/chan_modem.c
channels/chan_sip.c
devicestate.c
dnsmgr.c

diff --git a/cdr.c b/cdr.c
index d9cff74bd3ffcf3d3c6d0c54ce05c55fc61c7a9d..442de9c1fdd2a12f4174bda20e60f00ee219675e 100644 (file)
--- a/cdr.c
+++ b/cdr.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>
  *
@@ -1197,8 +1197,6 @@ static int do_reload(void)
           if it does not exist */
        if (enabled && batchmode && (!was_enabled || !was_batchmode) && (cdr_thread == AST_PTHREADT_NULL)) {
                ast_cond_init(&cdr_pending_cond, NULL);
-               pthread_attr_init(&attr);
-               pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
                if (ast_pthread_create(&cdr_thread, &attr, do_cdr, NULL) < 0) {
                        ast_log(LOG_ERROR, "Unable to start CDR thread.\n");
                        ast_sched_del(sched, cdr_sched);
index 4447bd7ff4201db8153e05d70c5122c6739d6006..d3b68e22685142677dea8e9dc6dfd31c9aaa5a2e 100644 (file)
@@ -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;
index f37a29e126ddbcf548e935dd341ebec193047e8e..09adc4733a383cc430b63760f12c50c00d5489f7 100644 (file)
@@ -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;
index 2c45421f5007a4e23c8531da864447b724b1d02f..537ede87176f034cbb77ead52ad28246716fd81c 100644 (file)
@@ -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);
index 73b77956833aa03fef5e37bd4d85e38311af9fb2..b1970915213a2c744be15d548cffb00c23f59520 100644 (file)
@@ -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>
  *
@@ -271,12 +271,8 @@ static void *do_devstate_changes(void *data)
 /*--- ast_device_state_engine_init: Initialize the device state engine in separate thread */
 int ast_device_state_engine_init(void)
 {
-       pthread_attr_t attr;
-
        ast_cond_init(&change_pending, NULL);
-       pthread_attr_init(&attr);
-       pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-       if (ast_pthread_create(&change_thread, &attr, do_devstate_changes, NULL) < 0) {
+       if (ast_pthread_create(&change_thread, NULL, do_devstate_changes, NULL) < 0) {
                ast_log(LOG_ERROR, "Unable to start device state change thread.\n");
                return -1;
        }
index 204033e15aeee073a449eb989784ae4069e64e98..bc577c8529a567c1cfdfc4121e51fb62a2bdef39 100644 (file)
--- a/dnsmgr.c
+++ b/dnsmgr.c
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2005, Kevin P. Fleming
+ * Copyright (C) 2005-2006, Kevin P. Fleming
  *
  * Kevin P. Fleming <kpfleming@digium.com>
  *
@@ -342,9 +342,7 @@ static int do_reload(int loading)
        /* if this reload enabled the manager, create the background thread
           if it does not exist */
        if (enabled && !was_enabled && (refresh_thread == AST_PTHREADT_NULL)) {
-               pthread_attr_init(&attr);
-               pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-               if (ast_pthread_create(&refresh_thread, &attr, do_refresh, NULL) < 0) {
+               if (ast_pthread_create(&refresh_thread, NULL, do_refresh, NULL) < 0) {
                        ast_log(LOG_ERROR, "Unable to start refresh thread.\n");
                }
                else {