From 4c9eded44dbae1701bb3b8f255865892b19e7f72 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 17 Jul 2009 18:40:28 +0200 Subject: further code simplification ... could even remove one mutex by using a better algorithm. I think I also spotted some situation in which a hang could have happened. As I can't fix it in v4 and less without moving to the new engine, I make no effort in testing this out. Hangs occur during shutdown, only (if at all). The code changes should also result in some mild performance improvement. Some bug potential, but overall the bug potential should have been greatly reduced. --- runtime/queue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/queue.c') diff --git a/runtime/queue.c b/runtime/queue.c index 37ec3663..a2bb4c1d 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -312,7 +312,6 @@ TurnOffDAMode(qqueue_t *pThis) * during the lifetime of DA-mode, depending on how often the DA worker receives an * inactivity timeout. -- rgerhards, 2008-01-25 */ -dbgprintf("XXX: getLogicalQueueSize(pThis->pqDA): %d\n", getLogicalQueueSize(pThis->pqDA)); if(getLogicalQueueSize(pThis->pqDA) == 0) { pThis->bRunsDA = 0; /* tell the world we are back in non-DA mode */ /* we destruct the queue object, which will also shutdown the queue worker. As the queue is empty, @@ -1270,7 +1269,7 @@ tryShutdownWorkersWithinActionTimeout(qqueue_t *pThis) * startup some workers again. So this is OK here. -- rgerhards, 2009-05-28 */ pThis->bEnqOnly = 1; - wtpSetState(pThis->pWtpReg, wtpState_SHUTDOWN_IMMEDIATE); + /* need to set this so that the DA queue begins shutdown in parallel! */ if(pThis->pqDA != NULL) { pThis->pqDA->bEnqOnly = 1; wtpSetState(pThis->pqDA->pWtpReg, wtpState_SHUTDOWN_IMMEDIATE); -- cgit v1.2.3