aboutsummaryrefslogtreecommitdiff
path: root/src/rt/sync/sync.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/sync/sync.h')
-rw-r--r--src/rt/sync/sync.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rt/sync/sync.h b/src/rt/sync/sync.h
index 902b5661..8c9a13f0 100644
--- a/src/rt/sync/sync.h
+++ b/src/rt/sync/sync.h
@@ -4,6 +4,11 @@
class sync {
public:
static void yield();
+ template <class T>
+ static bool compare_and_swap(T *address,
+ T oldValue, T newValue) {
+ return __sync_bool_compare_and_swap(address, oldValue, newValue);
+ }
};
#endif /* SYNC_H */