diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-03-26 16:09:48 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-03-26 16:09:48 +0000 |
| commit | 7dd8bc0a84bd5a04941728b18676e0c115c2a8d8 (patch) | |
| tree | 887efc75e83cdc5a74ea3451216317a32f2ba5d6 | |
| parent | ea06727f03593389529c6bf22781bb5f0a31906e (diff) | |
| download | bcm5719-llvm-7dd8bc0a84bd5a04941728b18676e0c115c2a8d8.tar.gz bcm5719-llvm-7dd8bc0a84bd5a04941728b18676e0c115c2a8d8.zip | |
Intrin.h: Implement _InterlockedExchangePointer
llvm-svn: 204827
| -rw-r--r-- | clang/lib/Headers/Intrin.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Headers/Intrin.h b/clang/lib/Headers/Intrin.h index 2ed88301cf9..90a218e6297 100644 --- a/clang/lib/Headers/Intrin.h +++ b/clang/lib/Headers/Intrin.h @@ -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 |

