]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-attachserverproc-dont-dequeue-if-not-in-queue-take-two-20040818
authorDerrick Brashear <shadow@dementia.org>
Wed, 25 Aug 2004 08:13:09 +0000 (08:13 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 25 Aug 2004 08:13:09 +0000 (08:13 +0000)
nWaiting ended up negative, because the dequeuer (GetCall) decremented.

(cherry picked from commit 399785acf166dac15123889c28974ff06d6d2de0)

src/rx/rx.c

index 892c2230a9acef517d9797fff1667dc2a47e2fdf..2ae09e0ef8962796a2577f94cf88362bb534fbbe 100644 (file)
@@ -4009,11 +4009,12 @@ rxi_AttachServerProc(register struct rx_call *call,
        if (call->flags & RX_CALL_WAIT_PROC) {
            /* Conservative:  I don't think this should happen */
            call->flags &= ~RX_CALL_WAIT_PROC;
-           MUTEX_ENTER(&rx_stats_mutex);
-           rx_nWaiting--;
-           MUTEX_EXIT(&rx_stats_mutex);
-           if (queue_IsOnQueue(call))
-               queue_Remove(call);
+           if (queue_IsOnQueue(call)) {
+               queue_Remove(call);
+               MUTEX_ENTER(&rx_stats_mutex);
+               rx_nWaiting--;
+               MUTEX_EXIT(&rx_stats_mutex);
+           }
        }
        call->state = RX_STATE_ACTIVE;
        call->mode = RX_MODE_RECEIVING;