diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-11-21 22:05:08 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-11-21 22:05:08 +0000 |
commit | bd77d1e39b0c7bd9bef384e8e66a099697e753c5 (patch) | |
tree | c6d7ecce657c4b4b16b1e94dba4c85b907ef5ecb /sched.c | |
parent | ce2723fbb9029dc529c21e1c604493bc92694f40 (diff) |
Unlock while processing schedule queue
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1779 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'sched.c')
-rwxr-xr-x | sched.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -342,6 +342,7 @@ int ast_sched_runq(struct sched_context *con) struct sched *current; struct timeval tv; int x=0; + int res; DEBUG(ast_log(LOG_DEBUG, "ast_sched_runq()\n")); ast_mutex_lock(&con->lock); @@ -370,7 +371,12 @@ int ast_sched_runq(struct sched_context *con) * the schedule queue. If that's what it wants to do, it * should return 0. */ - if (current->callback(current->data)) { + + ast_mutex_unlock(&con->lock); + res = current->callback(current->data); + ast_mutex_lock(&con->lock); + + if (res) { /* * If they return non-zero, we should schedule them to be * run again. |