[asterisk-commits] file: trunk r93187 - /trunk/channels/chan_unistim.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 17 07:34:03 CST 2007


Author: file
Date: Mon Dec 17 07:34:03 2007
New Revision: 93187

URL: http://svn.digium.com/view/asterisk?view=rev&rev=93187
Log:
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.

Modified:
    trunk/channels/chan_unistim.c

Modified: trunk/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=93187&r1=93186&r2=93187
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Mon Dec 17 07:34:03 2007
@@ -4591,6 +4591,7 @@
 				ast_verbose(VERBOSE_PREFIX_1 "Reloading unistim.conf...\n");
 			reload_config();
 		}
+		pthread_testcancel();
 	}
 	/* Never reached */
 	return NULL;
@@ -4617,7 +4618,7 @@
 		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);




More information about the asterisk-commits mailing list