summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/unix/atomic-ops.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-22 00:38:46 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-22 00:40:27 (GMT)
commit741b7621b3c71406359d75098f9bdf8d3567662f (patch)
tree67bdab23eb2238c175282a275ec08f2dd9431226 /Utilities/cmlibuv/src/unix/atomic-ops.h
parent3ccad39000281c40e2a7a5e078adc4f977e462dd (diff)
parent1f661e87a6a8304edb77bd30b546e5d113477c59 (diff)
downloadCMake-741b7621b3c71406359d75098f9bdf8d3567662f.zip
CMake-741b7621b3c71406359d75098f9bdf8d3567662f.tar.gz
CMake-741b7621b3c71406359d75098f9bdf8d3567662f.tar.bz2
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2017-02-21 (52ae8264)
Diffstat (limited to 'Utilities/cmlibuv/src/unix/atomic-ops.h')
-rw-r--r--Utilities/cmlibuv/src/unix/atomic-ops.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/Utilities/cmlibuv/src/unix/atomic-ops.h b/Utilities/cmlibuv/src/unix/atomic-ops.h
index 815e355..9dac255 100644
--- a/Utilities/cmlibuv/src/unix/atomic-ops.h
+++ b/Utilities/cmlibuv/src/unix/atomic-ops.h
@@ -43,8 +43,12 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
__compare_and_swap(ptr, &oldval, newval);
return out;
#elif defined(__MVS__)
- return __plo_CS(ptr, (unsigned int*) ptr,
- oldval, (unsigned int*) &newval);
+ unsigned int op4;
+ if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
+ (unsigned int*) ptr, *ptr, &op4))
+ return oldval;
+ else
+ return op4;
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif
@@ -67,13 +71,18 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
# endif /* if defined(__64BIT__) */
return out;
#elif defined (__MVS__)
-# ifdef _LP64
- return __plo_CSGR(ptr, (unsigned long long*) ptr,
- oldval, (unsigned long long*) &newval);
-# else
- return __plo_CS(ptr, (unsigned int*) ptr,
- oldval, (unsigned int*) &newval);
-# endif
+#ifdef _LP64
+ unsigned long long op4;
+ if (__plo_CSSTGR(ptr, (unsigned long long*) &oldval, newval,
+ (unsigned long long*) ptr, *ptr, &op4))
+#else
+ unsigned long op4;
+ if (__plo_CSST(ptr, (unsigned int*) &oldval, newval,
+ (unsigned int*) ptr, *ptr, &op4))
+#endif
+ return oldval;
+ else
+ return op4;
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif