aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 16:46:13 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-17 16:46:13 +0000
commite92ad91be488555880685790affc2b3a3c207e30 (patch)
tree70fc0295ee46d476bb08cd6269d115373916969b /include
parent167a0d33acdc2d8a1269116a7d8f007c9f864b0c (diff)
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. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@150606 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/sched.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h
index 993ba6b7e..92a5d76a4 100644
--- a/include/asterisk/sched.h
+++ b/include/asterisk/sched.h
@@ -72,6 +72,22 @@ extern "C" {
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 { \
int _count = 0; \