- Change dispatcher lock release to be more like documented in Windows Internals...
[reactos.git] / reactos / ntoskrnl / include / internal / ke.h
index 30bf212..9c8a49a 100644 (file)
@@ -51,6 +51,7 @@ extern ULONG_PTR KERNEL_BASE;
 #ifndef CONFIG_SMP
 #define KeInitializeDispatcher()
 #define KeAcquireDispatcherDatabaseLock() KeRaiseIrqlToDpcLevel();
+#define KeReleaseDispatcherDatabaseLock(OldIrql) KiExitDispatcher(OldIrql);
 #define KeAcquireDispatcherDatabaseLockAtDpcLevel()
 #define KeReleaseDispatcherDatabaseLockFromDpcLevel()
 #else
@@ -60,6 +61,9 @@ extern ULONG_PTR KERNEL_BASE;
     KeAcquireSpinLockAtDpcLevel (&DispatcherDatabaseLock);
 #define KeReleaseDispatcherDatabaseLockFromDpcLevel() \
     KeReleaseSpinLockFromDpcLevel(&DispatcherDatabaseLock);
+#define KeReleaseDispatcherDatabaseLock(OldIrql) \
+    KeReleaseSpinLockFromDpcLevel(&DispatcherDatabaseLock); \
+    KiExitDispatcher(OldIrql);
 #endif
 
 /* The following macro initializes a dispatcher object's header */
@@ -259,6 +263,10 @@ VOID
 STDCALL
 KiAdjustQuantumThread(IN PKTHREAD Thread);
 
+VOID
+FASTCALL
+KiExitDispatcher(KIRQL OldIrql);
+
 /* gmutex.c ********************************************************************/
 
 VOID
@@ -386,10 +394,6 @@ KiExpireTimers(
     PVOID SystemArgument2
 );
 
-VOID
-FASTCALL
-KeReleaseDispatcherDatabaseLock(KIRQL Irql);
-
 VOID
 STDCALL
 KeInitializeThread(