[ros-diffs] [ion] 20468: Make sure compiler doesn't optimize our wait loop away. Patch by Thomas Weidenmueller

ion at svn.reactos.org ion at svn.reactos.org
Fri Dec 30 21:31:37 CET 2005


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
         {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051230/9f9671fe/attachment.html


More information about the Ros-diffs mailing list