diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-26 16:07:58 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-26 16:07:58 +0000 |
commit | 89e5190478b443bbff998609198c33703264b496 (patch) | |
tree | 5b4885e23d6271da7fa1ee659c07b5fa607534f3 /channels | |
parent | a2248c0f07d8c569e2345dfa64689fddc4e38da4 (diff) |
Fix some bogus scheduler usage in chan_sip. This code used the return value
of a completely unrelated function to determine whether the scheduler should
be run or not. This would have caused the scheduler to not run in cases where
it should have. Also, leave a note about another scheduler issue that needs
to be addressed at some point.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@140060 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b4e83d440..5014f9935 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -16101,6 +16101,12 @@ restartsearch: } ast_mutex_unlock(&iflock); + /* XXX TODO The scheduler usage in this module does not have sufficient + * synchronization being done between running the scheduler and places + * scheduling tasks. As it is written, any scheduled item may not run + * any sooner than about 1 second, regardless of whether a sooner time + * was asked for. */ + pthread_testcancel(); /* Wait for sched or io */ res = ast_sched_wait(sched); @@ -16113,11 +16119,9 @@ restartsearch: if (option_debug && res > 20) ast_log(LOG_DEBUG, "chan_sip: ast_io_wait ran %d all at once\n", res); ast_mutex_lock(&monlock); - if (res >= 0) { - res = ast_sched_runq(sched); - if (option_debug && res >= 20) - ast_log(LOG_DEBUG, "chan_sip: ast_sched_runq ran %d all at once\n", res); - } + res = ast_sched_runq(sched); + if (option_debug && res >= 20) + ast_log(LOG_DEBUG, "chan_sip: ast_sched_runq ran %d all at once\n", res); /* Send MWI notifications to peers - static and cached realtime peers */ t = time(NULL); |