mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
Unlock while processing schedule queue
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
8
sched.c
8
sched.c
@@ -342,6 +342,7 @@ int ast_sched_runq(struct sched_context *con)
|
|||||||
struct sched *current;
|
struct sched *current;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int x=0;
|
int x=0;
|
||||||
|
int res;
|
||||||
DEBUG(ast_log(LOG_DEBUG, "ast_sched_runq()\n"));
|
DEBUG(ast_log(LOG_DEBUG, "ast_sched_runq()\n"));
|
||||||
|
|
||||||
ast_mutex_lock(&con->lock);
|
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
|
* the schedule queue. If that's what it wants to do, it
|
||||||
* should return 0.
|
* 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
|
* If they return non-zero, we should schedule them to be
|
||||||
* run again.
|
* run again.
|
||||||
|
Reference in New Issue
Block a user