Fix bug in gate code

svn path=/trunk/; revision=15942
This commit is contained in:
Alex Ionescu 2005-06-17 00:13:44 +00:00
parent c2167ebb58
commit 314e0eaf59

View file

@ -44,7 +44,7 @@ KeWaitForGate(PKGATE Gate,
do do
{ {
/* Lock the APC Queue */ /* Lock the APC Queue */
KeAcquireSpinLock(&CurrentThread->ApcQueueLock, &OldIrql); OldIrql = KeAcquireDispatcherDatabaseLock();
/* Check if it's already signaled */ /* Check if it's already signaled */
if (!Gate->Header.SignalState) if (!Gate->Header.SignalState)
@ -53,7 +53,7 @@ KeWaitForGate(PKGATE Gate,
Gate->Header.SignalState = 0; Gate->Header.SignalState = 0;
/* Unlock the Queue and return */ /* Unlock the Queue and return */
KeReleaseSpinLock(&CurrentThread->ApcQueueLock, OldIrql); KeReleaseDispatcherDatabaseLock(OldIrql);
return; return;
} }
@ -78,9 +78,6 @@ KeWaitForGate(PKGATE Gate,
KiWakeQueue(CurrentThread->Queue); KiWakeQueue(CurrentThread->Queue);
} }
/* Unlock the Queue*/
KeReleaseSpinLock(&CurrentThread->ApcQueueLock, OldIrql);
/* Block the Thread */ /* Block the Thread */
DPRINT("Blocking the Thread: %x\n", CurrentThread); DPRINT("Blocking the Thread: %x\n", CurrentThread);
KiBlockThread(&Status, KiBlockThread(&Status,