X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fntoskrnl%2Fke%2Fgate.c;h=228ed3cd31aead9ae7732f58f11eee953d921f1e;hp=6530667b7b6eca3634bc5cd1d8aefc349d2555a6;hb=92f9f2e23b4ba040ae4e71523a888f796d37ba37;hpb=afc39c026748d4648c7f617e81bd831ff9e22175 diff --git a/reactos/ntoskrnl/ke/gate.c b/reactos/ntoskrnl/ke/gate.c index 6530667b7b6..228ed3cd31a 100644 --- a/reactos/ntoskrnl/ke/gate.c +++ b/reactos/ntoskrnl/ke/gate.c @@ -78,12 +78,15 @@ KeWaitForGate(PKGATE Gate, KiWakeQueue(CurrentThread->Queue); } - /* Block the Thread */ - DPRINT("Blocking the Thread: %x\n", CurrentThread); - KiBlockThread(&Status, - CurrentThread->Alertable, - WaitMode, - WaitReason); + /* Setup the wait information */ + CurrentThread->WaitMode = WaitMode; + CurrentThread->WaitReason = WaitReason; + CurrentThread->WaitTime = 0; + CurrentThread->State = Waiting; + + /* Find a new thread to run */ + DPRINT("Swapping threads\n"); + Status = KiSwapThread(); /* Check if we were executing an APC */ if (Status != STATUS_KERNEL_APC) return;