[ros-diffs] [arty] 39130: This code used to round down the number of waiters to a multiple of 2. Fine if there are exactly one or zero waiters, not fine if there are 2 or more.

arty at svn.reactos.org arty at svn.reactos.org
Tue Jan 27 10:35:01 CET 2009


Author: arty
Date: Tue Jan 27 03:35:01 2009
New Revision: 39130

URL: http://svn.reactos.org/svn/reactos?rev=39130&view=rev
Log:
This code used to round down the number of waiters to a multiple of 2.  Fine
if there are exactly one or zero waiters, not fine if there are 2 or more.

Modified:
    trunk/reactos/ntoskrnl/ke/gmutex.c

Modified: trunk/reactos/ntoskrnl/ke/gmutex.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/gmutex.c?rev=39130&r1=39129&r2=39130&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/gmutex.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/gmutex.c [iso-8859-1] Tue Jan 27 03:35:01 2009
@@ -123,7 +123,7 @@
         
         /* The mutex will be woken, minus one waiter */
         NewValue = (OldValue | GM_LOCK_WAITER_WOKEN);
-        NewValue &= ~GM_LOCK_WAITER_INC;
+        NewValue -= GM_LOCK_WAITER_INC;
 
         /* Remove the Woken bit */
         if (InterlockedCompareExchange(&GuardedMutex->Count,



More information about the Ros-diffs mailing list