diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
| commit | 959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch) | |
| tree | acc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/platform/atomic_word.h | |
| parent | 76588293975fc059cf076779e4283e6ffaf8afff (diff) | |
New upstream version 6.0.20upstream
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. |
