aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-07 17:10:14 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-07 17:10:14 +0000
commit7558ac65bd4b6d13a080b9ad38cfcce16c8c8bde (patch)
tree696b932cfe9f3717c49d0f75b6eced1df885feec /channels
parent5e3a69b8fd79de40353c211022e6374ae7a3f86e (diff)
Merged revisions 128640 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r128640 | mmichelson | 2008-07-07 12:09:11 -0500 (Mon, 07 Jul 2008) | 18 lines Merged revisions 128639 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r128639 | mmichelson | 2008-07-07 12:02:28 -0500 (Mon, 07 Jul 2008) | 10 lines 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) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@128641 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 87b058b9d..a0cbf6e2a 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -455,6 +455,7 @@ static AST_LIST_HEAD_STATIC(registrations, iax2_registry);
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 {
@@ -1059,7 +1060,8 @@ static struct iax2_thread *find_idle_thread(void)
return NULL;
/* Set default values */
- thread->threadnum = ast_atomic_fetchadd_int(&iaxdynamicthreadcount, 1);
+ ast_atomic_fetchadd_int(&iaxdynamicthreadcount, 1);
+ thread->threadnum = ast_atomic_fetchadd_int(&iaxdynamicthreadnum, 1);
thread->type = IAX_THREAD_TYPE_DYNAMIC;
/* Initialize lock and condition */