summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/atomic-ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/unix/atomic-ops.h')
-rw-r--r--deps/uv/src/unix/atomic-ops.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/uv/src/unix/atomic-ops.h b/deps/uv/src/unix/atomic-ops.h
index 7e4e64beda..8fb157dcc6 100644
--- a/deps/uv/src/unix/atomic-ops.h
+++ b/deps/uv/src/unix/atomic-ops.h
@@ -33,6 +33,10 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
: "r" (newval), "0" (oldval)
: "memory");
return out;
+#elif defined(_AIX) && defined(__xlC__)
+ const int out = (*(volatile int*) ptr);
+ __compare_and_swap(ptr, &oldval, newval);
+ return out;
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif
@@ -46,6 +50,14 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
: "r" (newval), "0" (oldval)
: "memory");
return out;
+#elif defined(_AIX) && defined(__xlC__)
+ const long out = (*(volatile int*) ptr);
+# if defined(__64BIT__)
+ __compare_and_swaplp(ptr, &oldval, newval);
+# else
+ __compare_and_swap(ptr, &oldval, newval);
+# endif /* if defined(__64BIT__) */
+ return out;
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif