reactos/ntoskrnl/ps
diff -u -r1.88 -r1.89
--- create.c 12 Dec 2004 17:25:52 -0000 1.88
+++ create.c 18 Dec 2004 15:52:51 -0000 1.89
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.88 2004/12/12 17:25:52 hbirr Exp $
+/* $Id: create.c,v 1.89 2004/12/18 15:52:51 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -649,6 +649,7 @@
PTEB TebBase;
NTSTATUS Status;
PKAPC LdrInitApc;
+ KIRQL oldIrql;
DPRINT("NtCreateThread(ThreadHandle %x, PCONTEXT %x)\n",
ThreadHandle,ThreadContext);
@@ -735,10 +736,13 @@
* We must do this manually. Do NOT attempt to set the Thread to Alertable before the call,
* doing so is a blatant and erronous hack.
*/
- Thread->Tcb.ApcState.UserApcPending = TRUE;
- Thread->Tcb.Alerted[KernelMode] = TRUE;
+ Thread->Tcb.ApcState.UserApcPending = TRUE;
+ Thread->Tcb.Alerted[KernelMode] = TRUE;
+ oldIrql = KeAcquireDispatcherDatabaseLock ();
PsUnblockThread(Thread, NULL);
+ KeReleaseDispatcherDatabaseLock(oldIrql);
+
return(STATUS_SUCCESS);
}
@@ -774,6 +778,7 @@
{
PETHREAD Thread;
NTSTATUS Status;
+ KIRQL oldIrql;
DPRINT("PsCreateSystemThread(ThreadHandle %x, ProcessHandle %x)\n",
ThreadHandle,ProcessHandle);
@@ -801,7 +806,9 @@
*ClientId=Thread->Cid;
}
- PsUnblockThread(Thread, NULL);
+ oldIrql = KeAcquireDispatcherDatabaseLock ();
+ PsUnblockThread(Thread, NULL);
+ KeReleaseDispatcherDatabaseLock(oldIrql);
return(STATUS_SUCCESS);
}