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: https://origsvn.digium.com/svn/asterisk/trunk@93187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Joshua Colp 18 years ago
parent aac55b20b6
commit 6267956bda

@ -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);

Loading…
Cancel
Save