summaryrefslogtreecommitdiff
path: root/runtime/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/atomic.h')
-rw-r--r--runtime/atomic.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/atomic.h b/runtime/atomic.h
index 0faa3c69c6..d4a7f37bc6 100644
--- a/runtime/atomic.h
+++ b/runtime/atomic.h
@@ -278,6 +278,10 @@ class PACKED(sizeof(T)) Atomic : public std::atomic<T> {
return this->fetch_add(value, std::memory_order_seq_cst); // Return old_value.
}
+ T FetchAndAddRelaxed(const T value) {
+ return this->fetch_add(value, std::memory_order_relaxed); // Return old_value.
+ }
+
T FetchAndSubSequentiallyConsistent(const T value) {
return this->fetch_sub(value, std::memory_order_seq_cst); // Return old value.
}