Commit 8bdb4ab2 authored by Bob Halley's avatar Bob Halley
Browse files

only UNLOCK and then LOCK if actually sending an event

parent 4a9478d4
......@@ -621,17 +621,18 @@ run(void *uap) {
INSIST(!EMPTY(task->events));
event = HEAD(task->events);
DEQUEUE(task->events, event, link);
UNLOCK(&task->lock);
/*
* Execute the event action.
*/
XTRACE("execute action");
if (event->action != NULL)
if (event->action != NULL) {
UNLOCK(&task->lock);
(event->action)(task, event);
LOCK(&task->lock);
}
dispatch_count++;
LOCK(&task->lock);
if (EMPTY(task->events)) {
/*
* Nothing else to do for this task
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment