From: Jeffrey Altman Date: Tue, 27 Dec 2011 01:56:38 +0000 (-0500) Subject: Windows: osisleep do not tamper with queues X-Git-Tag: openafs-stable-1_8_0pre1~2890 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f6f95ac4bfc5e504c1b825fd52b787d12a89e53c Windows: osisleep do not tamper with queues There is no need to manually remove an entry from a queue before executing osi_QRemoveHT(). osi_QRemoveHT() removes the item from the queue and fixes up the pointers correctly. Manual intervention is a waste of cpu and can be harmful. Change-Id: Iaea4ceac2cb5f61e5bb73fd181bd934e06ddf0a6 Reviewed-on: http://gerrit.openafs.org/6437 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/client_osi/osisleep.c b/src/WINNT/client_osi/osisleep.c index 5b2e0d4..ddf4edf 100644 --- a/src/WINNT/client_osi/osisleep.c +++ b/src/WINNT/client_osi/osisleep.c @@ -325,7 +325,6 @@ void osi_TSignal(osi_turnstile_t *turnp) return; sp = turnp->lastp; - turnp->lastp = (osi_sleepInfo_t *) osi_QPrev(&sp->q); osi_QRemoveHT((osi_queue_t **) &turnp->firstp, (osi_queue_t **) &turnp->lastp, &sp->q); sp->states |= OSI_SLEEPINFO_SIGNALLED; ReleaseSemaphore(sp->sema, 1, (long *) 0); @@ -337,7 +336,6 @@ void osi_TBroadcast(osi_turnstile_t *turnp) osi_sleepInfo_t *sp; while(sp = turnp->lastp) { - turnp->lastp = (osi_sleepInfo_t *) osi_QPrev(&sp->q); osi_QRemoveHT((osi_queue_t **) &turnp->firstp, (osi_queue_t **) &turnp->lastp, &sp->q); sp->states |= OSI_SLEEPINFO_SIGNALLED; ReleaseSemaphore(sp->sema, 1, (long *) 0); @@ -384,7 +382,6 @@ void osi_TSignalForMLs(osi_turnstile_t *turnp, int stillHaveReaders, CRITICAL_SE * and move to private one, so we can do the wakeup after releasing * the crit sec. */ - turnp->lastp = (osi_sleepInfo_t *) osi_QPrev(&tsp->q); osi_QRemoveHT((osi_queue_t **) &turnp->firstp, (osi_queue_t **) &turnp->lastp, &tsp->q); /* do the patching required for lock obtaining */