Author: hpoussin
Date: Sun Jun 11 17:00:47 2006
New Revision: 22309
URL:
http://svn.reactos.ru/svn/reactos?rev=22309&view=rev
Log:
Fix non-optimized versions of InterlockedIncrement/InterlockedDecrement.
Fixes bug 916
Modified:
trunk/reactos/lib/intrlck/decrement.c
trunk/reactos/lib/intrlck/increment.c
Modified: trunk/reactos/lib/intrlck/decrement.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/decrement.c?rev…
==============================================================================
--- trunk/reactos/lib/intrlck/decrement.c (original)
+++ trunk/reactos/lib/intrlck/decrement.c Sun Jun 11 17:00:47 2006
@@ -21,10 +21,5 @@
InterlockedDecrement(
LPLONG lpAddend)
{
- LONG ret;
-
- ret = *lpAddend;
- ret = InterlockedExchangeAdd( lpAddend, ret - 1 );
-
- return ret;
+ return InterlockedExchangeAdd( lpAddend, -1 ) - 1;
}
Modified: trunk/reactos/lib/intrlck/increment.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/intrlck/increment.c?rev…
==============================================================================
--- trunk/reactos/lib/intrlck/increment.c (original)
+++ trunk/reactos/lib/intrlck/increment.c Sun Jun 11 17:00:47 2006
@@ -19,12 +19,7 @@
LONG NTAPI
InterlockedIncrement(
- PLONG Addend)
+ LPLONG lpAddend)
{
- LONG ret;
-
- ret = *Addend;
- ret = InterlockedExchangeAdd( Addend, ret + 1 );
-
- return ret;
+ return InterlockedExchangeAdd( lpAddend, 1 ) + 1;
}