diff options
Diffstat (limited to 'src/mongo/platform/atomic_word.h')
| -rw-r--r-- | src/mongo/platform/atomic_word.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/platform/atomic_word.h b/src/mongo/platform/atomic_word.h index c277497b15c..5a7d38ccca7 100644 --- a/src/mongo/platform/atomic_word.h +++ b/src/mongo/platform/atomic_word.h @@ -87,9 +87,7 @@ public: } /** - * Gets the current value of this AtomicWord. - * - * Has relaxed semantics. + * Gets the current value of this AtomicWord using relaxed memory order. */ WordType loadRelaxed() const { return _value.load(std::memory_order_relaxed); @@ -103,6 +101,13 @@ public: } /** + * Sets the value of this AtomicWord to "newValue" using relaxed memory order. + */ + void storeRelaxed(WordType newValue) { + _value.store(newValue, std::memory_order_relaxed); + } + + /** * Atomically swaps the current value of this with "newValue". * * Returns the old value. |
