Commit efd11b1e authored by Frederik Gladhorn's avatar Frederik Gladhorn
Browse files

Merge remote-tracking branch 'origin/stable' into dev

Change-Id: Id041591bce92162e8c615034c24c56199064e76d
No related merge requests found
Showing with 2 additions and 16 deletions
...@@ -71,18 +71,10 @@ ...@@ -71,18 +71,10 @@
#if OS(WINDOWS) && !OS(WINCE) #if OS(WINDOWS) && !OS(WINCE)
#include <windows.h> #include <windows.h>
#elif OS(DARWIN)
#include <libkern/OSAtomic.h>
#elif OS(ANDROID) && !PLATFORM(QT) #elif OS(ANDROID) && !PLATFORM(QT)
#include <cutils/atomic.h> #include <cutils/atomic.h>
#elif OS(QNX) #elif OS(QNX)
#include <atomic.h> #include <atomic.h>
#elif COMPILER(GCC) && !OS(SYMBIAN)
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
#include <ext/atomicity.h>
#else
#include <bits/atomicity.h>
#endif
#endif #endif
#if USE(PTHREADS) #if USE(PTHREADS)
...@@ -230,12 +222,6 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r ...@@ -230,12 +222,6 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r
inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast<long volatile*>(addend)); } inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast<long volatile*>(addend)); }
#endif #endif
#elif OS(DARWIN)
#define WTF_USE_LOCKFREE_THREADSAFESHARED 1
inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); }
inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(addend)); }
#elif OS(ANDROID) && !PLATFORM(QT) #elif OS(ANDROID) && !PLATFORM(QT)
inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); }
...@@ -250,8 +236,8 @@ inline int atomicDecrement(int volatile* addend) { return (int) atomic_sub_value ...@@ -250,8 +236,8 @@ inline int atomicDecrement(int volatile* addend) { return (int) atomic_sub_value
#elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc
#define WTF_USE_LOCKFREE_THREADSAFESHARED 1 #define WTF_USE_LOCKFREE_THREADSAFESHARED 1
inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); }
inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; } inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
#endif #endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment