[asterisk-commits] mmichelson: branch group/manager2 r111949 - /team/group/manager2/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Mar 29 01:19:30 CDT 2008


Author: mmichelson
Date: Sat Mar 29 01:19:29 2008
New Revision: 111949

URL: http://svn.digium.com/view/asterisk?view=rev&rev=111949
Log:
Remove some compiler warnings. Add ast_cond_signal 
to the subscribe_end function to wake up the potentially
waiting thread so that pthread_join doesn't block forever. I
think this still is problematic though, since the signal could
be delivered while the event_spitter is not waiting for the
signal.


Modified:
    team/group/manager2/res/res_manager2.c

Modified: team/group/manager2/res/res_manager2.c
URL: http://svn.digium.com/view/asterisk/team/group/manager2/res/res_manager2.c?view=diff&rev=111949&r1=111948&r2=111949
==============================================================================
--- team/group/manager2/res/res_manager2.c (original)
+++ team/group/manager2/res/res_manager2.c Sat Mar 29 01:19:29 2008
@@ -185,14 +185,17 @@
  * \note Currently, though this is designed to be a callback from an event as described above
  * it is not actually implemented.
  */
-static void subscribe_end(const struct ast_event *event, void *ignore)
+static void  __attribute__ ((unused)) subscribe_end(const struct ast_event *event, void *ignore)
 {
 	struct subscriber *sub;
 	const char *name = ast_event_get_ie_str(event, AST_EVENT_IE_USERNAME);
 	int fd = ast_event_get_ie_uint(event, AST_EVENT_IE_FD);
 	
-	if (sub = remove_subscriber(name, fd)) {
+	if ((sub = remove_subscriber(name, fd))) {
+		ast_mutex_lock(&sub->lock);
 		sub->stop = 1;
+		ast_cond_signal(&sub->cond);
+		ast_mutex_unlock(&sub->lock);
 		pthread_join(sub->thread, NULL);
 	}
 }




More information about the asterisk-commits mailing list