r204827 - Intrin.h: Implement _InterlockedExchangePointer
Reid Kleckner
reid at kleckner.net
Wed Mar 26 09:09:48 PDT 2014
Author: rnk
Date: Wed Mar 26 11:09:48 2014
New Revision: 204827
URL: http://llvm.org/viewvc/llvm-project?rev=204827&view=rev
Log:
Intrin.h: Implement _InterlockedExchangePointer
Modified:
cfe/trunk/lib/Headers/Intrin.h
Modified: cfe/trunk/lib/Headers/Intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Intrin.h?rev=204827&r1=204826&r2=204827&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/Intrin.h (original)
+++ cfe/trunk/lib/Headers/Intrin.h Wed Mar 26 11:09:48 2014
@@ -422,6 +422,7 @@ static __inline__
__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
static __inline__
__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
+static __inline__
void *_InterlockedExchangePointer(void *volatile *_Target, void *_Value);
static __inline__
__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
@@ -795,6 +796,11 @@ _InterlockedExchange64(__int64 volatile
__atomic_exchange(_Target, &_Value, &_Value, 0);
return _Value;
}
+static __inline__ void *__attribute__((__always_inline__, __nodebug__))
+_InterlockedExchangePointer(void *volatile *_Target, void *_Value) {
+ __atomic_exchange(_Target, &_Value, &_Value, 0);
+ return _Value;
+}
#endif
/*----------------------------------------------------------------------------*\
|* Interlocked Compare Exchange
More information about the cfe-commits
mailing list