diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-08-26 16:10:06 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-08-26 16:10:06 +0000 |
commit | d787786ac981e6b2a50a02bb96ae1891157cf640 (patch) | |
tree | d54c63dd3bc17ea17362dfa39310423b40b0c85d | |
parent | 8953b0f3594eb43530530162729f7cee19e07db0 (diff) |
Merged revisions 140060 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r140060 | russell | 2008-08-26 11:07:58 -0500 (Tue, 26 Aug 2008) | 6 lines
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: https://origsvn.digium.com/svn/asterisk/trunk@140061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-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 9b32f2647..a96b3c425 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -19546,6 +19546,12 @@ static void *do_monitor(void *data) dialog that was found and destroyed, probably because the list contents would change, so we'd need to restart. This isn't the best thing to do with callbacks. */ + /* 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); @@ -19555,11 +19561,9 @@ static void *do_monitor(void *data) if (res > 20) ast_debug(1, "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 (res >= 20) - ast_debug(1, "chan_sip: ast_sched_runq ran %d all at once\n", res); - } + res = ast_sched_runq(sched); + if (res >= 20) + ast_debug(1, "chan_sip: ast_sched_runq ran %d all at once\n", res); ast_mutex_unlock(&monlock); } |