[svn-commits] mmichelson: branch 1.4 r128639 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 7 12:02:29 CDT 2008


Author: mmichelson
Date: Mon Jul  7 12:02:28 2008
New Revision: 128639

URL: http://svn.digium.com/view/asterisk?view=rev&rev=128639
Log:
By using the iaxdynamicthreadcount to identify a thread, it was possible
for thread identifiers to be duplicated. By using a globally-unique monotonically-
increasing integer, this is now avoided.

(closes issue #13009)
Reported by: jpgrayson
Patches:
      chan_iax2_dyn_threadnum.patch uploaded by jpgrayson (license 492)


Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=128639&r1=128638&r2=128639
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Mon Jul  7 12:02:28 2008
@@ -446,6 +446,7 @@
 static int iaxthreadcount = DEFAULT_THREAD_COUNT;
 static int iaxmaxthreadcount = DEFAULT_MAX_THREAD_COUNT;
 static int iaxdynamicthreadcount = 0;
+static int iaxdynamicthreadnum = 0;
 static int iaxactivethreadcount = 0;
 
 struct iax_rr {
@@ -920,7 +921,7 @@
 		if (thread == NULL && iaxmaxthreadcount > iaxdynamicthreadcount) {
 			/* We need to MAKE a thread! */
 			if ((thread = ast_calloc(1, sizeof(*thread)))) {
-				thread->threadnum = iaxdynamicthreadcount;
+				thread->threadnum = iaxdynamicthreadnum++;
 				thread->type = IAX_TYPE_DYNAMIC;
 				ast_mutex_init(&thread->lock);
 				ast_cond_init(&thread->cond, NULL);




More information about the svn-commits mailing list