From 8bdb4ab2d14e9f7ddcb082cee397eab60a5e7316 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Thu, 1 Apr 1999 01:09:28 +0000 Subject: [PATCH] only UNLOCK and then LOCK if actually sending an event --- lib/isc/task.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/isc/task.c b/lib/isc/task.c index 3961d79acf..3f59fc96a7 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -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