aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_unistim.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-17 13:34:03 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-17 13:34:03 +0000
commit602260a0ef5451b118d994e3fd85d717bfb6496a (patch)
tree2166ad45c628bd38c94bbc0bc69676a3594cb3fd /channels/chan_unistim.c
parentb4ee38f320a0de1a7d886dfc5b5025574610ec26 (diff)
Make chan_unistim actually be able to unload. When creating a thread that you want to pthread_join you have to explicitly create it as joinable, and also if using pthread_cancel you have to have a pthread_testcancel to see if it has been called.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93187 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_unistim.c')
-rw-r--r--channels/chan_unistim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index d4cb0f347..a6742b5f4 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -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);