summaryrefslogtreecommitdiffstats
path: root/raul/Maid.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'raul/Maid.hpp')
-rw-r--r--raul/Maid.hpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/raul/Maid.hpp b/raul/Maid.hpp
index 7f5a299..29b6473 100644
--- a/raul/Maid.hpp
+++ b/raul/Maid.hpp
@@ -102,13 +102,8 @@ public:
*/
inline void cleanup() {
// Atomically get the head of the disposed list
- Disposable* disposed;
- do {
- disposed = _disposed.load(std::memory_order_relaxed);
- } while (!_disposed.compare_exchange_weak(
- disposed, nullptr,
- std::memory_order_acquire,
- std::memory_order_relaxed));
+ Disposable* const disposed = _disposed.exchange(
+ nullptr, std::memory_order_acquire);
// Free the disposed list
for (Disposable* obj = disposed; obj;) {