[asterisk-commits] file: trunk r49525 - /trunk/main/manager.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 4 14:40:54 MST 2007


Author: file
Date: Thu Jan  4 15:40:54 2007
New Revision: 49525

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49525
Log:
It's pretty difficult to pthread_kill a thread that doesn't exist. (issue #8681 reported by bkruse)

Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=49525&r1=49524&r2=49525
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Thu Jan  4 15:40:54 2007
@@ -109,7 +109,6 @@
 static int timestampevents;
 static int httptimeout = 60;
 
-static pthread_t accept_thread_ptr;	/*!< the accept thread */
 static int block_sockets;
 static int num_sessions;
 
@@ -640,10 +639,8 @@
  */
 static struct eventqent *unref_event(struct eventqent *e)
 {
-	struct eventqent *ret = AST_LIST_NEXT(e, eq_next);
-	if (ast_atomic_dec_and_test(&e->usecount) && ret)
-		pthread_kill(accept_thread_ptr, SIGURG);
-	return ret;
+	ast_atomic_fetchadd_int(&e->usecount, -1);
+	return AST_LIST_NEXT(e, eq_next);
 }
 
 static void ref_event(struct eventqent *e)



More information about the asterisk-commits mailing list