Author: ion
Date: Mon Oct 23 00:39:08 2006
New Revision: 24611
URL:
http://svn.reactos.org/svn/reactos?rev=24611&view=rev
Log:
- Fix KeFreezeAllThreads prototype and define it in the internal headers.
- Fix two bugs in KeSetBasePriorityThread and KeSetPriorityThread which were using an
undefined value for "Lock Released" if the priority wasn't changing,
potentially causing a missing spinlock release when none was required (and thus eventually
freezing the scheduler)
Modified:
trunk/reactos/ntoskrnl/include/internal/ke.h
trunk/reactos/ntoskrnl/ke/thrdobj.c
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h Mon Oct 23 00:39:08 2006
@@ -526,6 +526,12 @@
NTAPI
KeForceResumeThread(IN PKTHREAD Thread);
+VOID
+NTAPI
+KeFreezeAllThreads(
+ VOID
+);
+
BOOLEAN
NTAPI
KeDisableThreadApcQueueing(IN PKTHREAD Thread);
Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdobj.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/thrdobj.c (original)
+++ trunk/reactos/ntoskrnl/ke/thrdobj.c Mon Oct 23 00:39:08 2006
@@ -232,16 +232,13 @@
return PreviousCount;
}
-/*
- * Used by the debugging code to freeze all the process's threads
- * while the debugger is examining their state.
- */
VOID
NTAPI
-KeFreezeAllThreads(IN PKPROCESS Process)
+KeFreezeAllThreads(VOID)
{
KLOCK_QUEUE_HANDLE LockHandle, ApcLock;
PKTHREAD Current, CurrentThread = KeGetCurrentThread();
+ PKPROCESS Process = CurrentThread->ApcState.Process;
PLIST_ENTRY ListHead, NextEntry;
LONG OldCount;
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
@@ -1062,7 +1059,7 @@
KPRIORITY OldBasePriority, Priority, BasePriority;
LONG OldIncrement;
PKPROCESS Process;
- BOOLEAN Released;
+ BOOLEAN Released = FALSE;
ASSERT_THREAD(Thread);
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
@@ -1218,7 +1215,7 @@
{
KIRQL OldIrql;
KPRIORITY OldPriority;
- BOOLEAN Released;
+ BOOLEAN Released = FALSE;
ASSERT_THREAD(Thread);
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
ASSERT((Priority <= HIGH_PRIORITY) && (Priority >= LOW_PRIORITY));