diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-07 17:09:11 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-07 17:09:11 +0000 |
commit | 86dd1db1e301289b6e5b09eb15a8dba16690a658 (patch) | |
tree | 92e17fe3b7a96e885dbc4c21316598459337dbdb /channels/chan_iax2.c | |
parent | d2906c8507665060d238237d890c59be8baf897b (diff) |
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/trunk@128640 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 452a8e654..80a49d830 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -452,6 +452,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 { @@ -1066,7 +1067,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 */ |