Author: tkreuzer
Date: Thu Jan 27 23:03:01 2011
New Revision: 50522
URL:
http://svn.reactos.org/svn/reactos?rev=50522&view=rev
Log:
[RTL]
_Interlocked(Compare)ExchangePointer is an intrinsic that doesn't exist on x86, use
portable version.
Modified:
branches/cmake-bringup/lib/rtl/srw.c
Modified: branches/cmake-bringup/lib/rtl/srw.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/rtl/srw.c?rev…
==============================================================================
--- branches/cmake-bringup/lib/rtl/srw.c [iso-8859-1] (original)
+++ branches/cmake-bringup/lib/rtl/srw.c [iso-8859-1] Thu Jan 27 23:03:01 2011
@@ -131,7 +131,7 @@
}
}
- (void)_InterlockedExchangePointer(&SRWLock->Ptr, (PVOID)NewValue);
+ (void)InterlockedExchangePointer(&SRWLock->Ptr, (PVOID)NewValue);
if (FirstWaitBlock->Exclusive)
{
@@ -186,7 +186,7 @@
NewValue = RTL_SRWLOCK_OWNED;
}
- (void)_InterlockedExchangePointer(&SRWLock->Ptr, (PVOID)NewValue);
+ (void)InterlockedExchangePointer(&SRWLock->Ptr, (PVOID)NewValue);
(void)InterlockedOr(&FirstWaitBlock->Wake,
TRUE);
@@ -420,9 +420,9 @@
NewValue = (CurrentValue >> RTL_SRWLOCK_BITS) + 1;
NewValue = (NewValue << RTL_SRWLOCK_BITS) | (CurrentValue &
RTL_SRWLOCK_MASK);
- if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
- (PVOID)NewValue,
- (PVOID)CurrentValue) ==
CurrentValue)
+ if ((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) ==
CurrentValue)
{
/* Successfully incremented the shared count, we acquired the lock
*/
break;
@@ -499,9 +499,9 @@
ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED |
RTL_SRWLOCK_CONTENDED;
- if
((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
- (PVOID)NewValue,
- (PVOID)CurrentValue)
== CurrentValue)
+ if
((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue)
== CurrentValue)
{
RtlpAcquireSRWLockSharedWait(SRWLock,
&StackWaitBlock,
@@ -521,9 +521,9 @@
RTL_SRWLOCK_SHARED nor the RTL_SRWLOCK_OWNED bit is set */
ASSERT(!(CurrentValue & RTL_SRWLOCK_CONTENDED));
- if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
- (PVOID)NewValue,
- (PVOID)CurrentValue) ==
CurrentValue)
+ if ((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) ==
CurrentValue)
{
/* Successfully set the shared count, we acquired the lock */
break;
@@ -580,9 +580,9 @@
NewValue = (NewValue << RTL_SRWLOCK_BITS) | RTL_SRWLOCK_SHARED
| RTL_SRWLOCK_OWNED;
}
- if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
- (PVOID)NewValue,
- (PVOID)CurrentValue) ==
CurrentValue)
+ if ((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) ==
CurrentValue)
{
/* Successfully released the lock */
break;
@@ -639,9 +639,9 @@
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_SHARED |
RTL_SRWLOCK_CONTENDED | RTL_SRWLOCK_OWNED;
- if
((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
- (PVOID)NewValue,
- (PVOID)CurrentValue)
== CurrentValue)
+ if
((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue)
== CurrentValue)
{
RtlpAcquireSRWLockExclusiveWait(SRWLock,
&StackWaitBlock);
@@ -697,9 +697,9 @@
ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED |
RTL_SRWLOCK_CONTENDED;
- if
((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
-
(PVOID)NewValue,
-
(PVOID)CurrentValue) == CurrentValue)
+ if
((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+
(PVOID)CurrentValue) == CurrentValue)
{
RtlpAcquireSRWLockExclusiveWait(SRWLock,
&StackWaitBlock);
@@ -767,9 +767,9 @@
ASSERT(!(CurrentValue & ~RTL_SRWLOCK_OWNED));
NewValue = 0;
- if ((LONG_PTR)_InterlockedCompareExchangePointer(&SRWLock->Ptr,
- (PVOID)NewValue,
- (PVOID)CurrentValue) ==
CurrentValue)
+ if ((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
+ (PVOID)NewValue,
+ (PVOID)CurrentValue) ==
CurrentValue)
{
/* We released the lock */
break;