Intrin.h: Implement _InterlockedExchangePointer

llvm-svn: 204827
This commit is contained in:
Reid Kleckner 2014-03-26 16:09:48 +00:00
parent ea06727f03
commit 7dd8bc0a84
1 changed files with 6 additions and 0 deletions

View File

@ -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 *_Target, __int64 _Value) {
__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