Fix non-optimized versions of InterlockedIncrement/InterlockedDecrement.

Fixes bug 916

svn path=/trunk/; revision=22309
This commit is contained in:
Hervé Poussineau 2006-06-11 13:00:47 +00:00
parent f08c410f39
commit b9bcb95e37
2 changed files with 3 additions and 13 deletions

View file

@ -21,10 +21,5 @@ LONG NTAPI
InterlockedDecrement(
LPLONG lpAddend)
{
LONG ret;
ret = *lpAddend;
ret = InterlockedExchangeAdd( lpAddend, ret - 1 );
return ret;
return InterlockedExchangeAdd( lpAddend, -1 ) - 1;
}

View file

@ -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;
}