[asterisk-commits] tilghman: branch 1.6.1 r150606 - in /branches/1.6.1: ./ channels/ include/ast...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 17 11:46:13 CDT 2008
Author: tilghman
Date: Fri Oct 17 11:46:13 2008
New Revision: 150606
URL: http://svn.digium.com/view/asterisk?view=rev&rev=150606
Log:
Merged revisions 150580 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r150580 | tilghman | 2008-10-17 11:34:29 -0500 (Fri, 17 Oct 2008) | 2 lines
Fix the FRACK! warnings in chan_iax2 when POKE/LAGRQ packets are not answered.
........
Modified:
branches/1.6.1/ (props changed)
branches/1.6.1/channels/chan_iax2.c
branches/1.6.1/include/asterisk/sched.h
Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.1/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/channels/chan_iax2.c?view=diff&rev=150606&r1=150605&r2=150606
==============================================================================
--- branches/1.6.1/channels/chan_iax2.c (original)
+++ branches/1.6.1/channels/chan_iax2.c Fri Oct 17 11:46:13 2008
@@ -1412,6 +1412,8 @@
return res;
}
+/*!\note Assumes the lock on the pvt is already held, when
+ * iax2_destroy_helper() is called. */
static void iax2_destroy_helper(struct chan_iax2_pvt *pvt)
{
/* Decrement AUTHREQ count if needed */
@@ -1430,8 +1432,8 @@
ast_clear_flag(pvt, IAX_MAXAUTHREQ);
}
/* No more pings or lagrq's */
- AST_SCHED_DEL(sched, pvt->pingid);
- AST_SCHED_DEL(sched, pvt->lagid);
+ AST_SCHED_DEL_SPINLOCK(sched, pvt->pingid, &iaxsl[pvt->callno]);
+ AST_SCHED_DEL_SPINLOCK(sched, pvt->lagid, &iaxsl[pvt->callno]);
AST_SCHED_DEL(sched, pvt->autoid);
AST_SCHED_DEL(sched, pvt->authid);
AST_SCHED_DEL(sched, pvt->initid);
@@ -1450,7 +1452,9 @@
struct chan_iax2_pvt *pvt = obj;
struct iax_frame *cur = NULL;
+ ast_mutex_lock(&iaxsl[pvt->callno]);
iax2_destroy_helper(pvt);
+ ast_mutex_unlock(&iaxsl[pvt->callno]);
/* Already gone */
ast_set_flag(pvt, IAX_ALREADYGONE);
@@ -2309,6 +2313,8 @@
retry:
pvt = iaxs[callno];
+ iax2_destroy_helper(pvt);
+
lastused[callno] = ast_tvnow();
owner = pvt ? pvt->owner : NULL;
Modified: branches/1.6.1/include/asterisk/sched.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/include/asterisk/sched.h?view=diff&rev=150606&r1=150605&r2=150606
==============================================================================
--- branches/1.6.1/include/asterisk/sched.h (original)
+++ branches/1.6.1/include/asterisk/sched.h Fri Oct 17 11:46:13 2008
@@ -71,6 +71,22 @@
refcall; \
id = -1; \
} while (0);
+
+#define AST_SCHED_DEL_SPINLOCK(sched, id, lock) \
+ ({ \
+ int _count = 0; \
+ int _sched_res = -1; \
+ while (id > -1 && (_sched_res = ast_sched_del(sched, id)) && ++_count < 10) { \
+ ast_mutex_unlock(lock); \
+ usleep(1); \
+ ast_mutex_lock(lock); \
+ } \
+ if (_count == 10 && option_debug > 2) { \
+ ast_log(LOG_DEBUG, "Unable to cancel schedule ID %d.\n", id); \
+ } \
+ id = -1; \
+ (_sched_res); \
+ })
#define AST_SCHED_REPLACE_VARIABLE(id, sched, when, callback, data, variable) \
do { \
More information about the asterisk-commits
mailing list