Make sure compiler doesn't optimize our wait loop away. Patch by Thomas
Weidenmueller
Modified: trunk/reactos/ntoskrnl/ke/spinlock.c
_____
Modified: trunk/reactos/ntoskrnl/ke/spinlock.c
--- trunk/reactos/ntoskrnl/ke/spinlock.c 2005-12-30 20:28:35 UTC
(rev 20467)
+++ trunk/reactos/ntoskrnl/ke/spinlock.c 2005-12-30 20:31:11 UTC
(rev 20468)
@@ -151,7 +151,7 @@
if (InterlockedBitTestAndSet((PLONG)SpinLock, 0))
{
/* Value changed... wait until it's locked */
- while (*SpinLock == 1) YieldProcessor();
+ while (*(volatile KSPIN_LOCK *)SpinLock == 1)
YieldProcessor();
}
else
{
Show replies by date