diff options
Diffstat (limited to 'runtime/atomic.h')
-rw-r--r-- | runtime/atomic.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/atomic.h b/runtime/atomic.h index 87de506a85..0faa3c69c6 100644 --- a/runtime/atomic.h +++ b/runtime/atomic.h @@ -199,6 +199,11 @@ class PACKED(sizeof(T)) Atomic : public std::atomic<T> { return this->load(std::memory_order_relaxed); } + // Load from memory with acquire ordering. + T LoadAcquire() const { + return this->load(std::memory_order_acquire); + } + // Word tearing allowed, but may race. // TODO: Optimize? // There has been some discussion of eventually disallowing word |