Make chan_unistim actually be able to unload. When creating a thread that you want...
authorJoshua Colp <jcolp@digium.com>
Mon, 17 Dec 2007 13:34:03 +0000 (13:34 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 17 Dec 2007 13:34:03 +0000 (13:34 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93187 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_unistim.c

index d4cb0f3..a6742b5 100644 (file)
@@ -4591,6 +4591,7 @@ static void *do_monitor(void *data)
                                ast_verbose(VERBOSE_PREFIX_1 "Reloading unistim.conf...\n");
                        reload_config();
                }
+               pthread_testcancel();
        }
        /* Never reached */
        return NULL;
@@ -4617,7 +4618,7 @@ static int restart_monitor(void)
                pthread_kill(monitor_thread, SIGURG);
        } else {
                pthread_attr_init(&attr);
-               pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+               pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
                /* Start a new monitor */
                if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
                        ast_mutex_unlock(&monlock);