diff options
author | Tomas Maly <[email protected]> | 2021-05-06 00:11:02 +0200 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2021-05-06 11:00:45 +1200 |
commit | 701b73c5c8d0b25b06e547ca2c969e1b00678772 (patch) | |
tree | b1d10a4cdfe5d49640294c6ad3090eb001e31ee7 | |
parent | fa0645fed9d2fa8dfbcf911812d6708c806e67b3 (diff) | |
download | cubeb-701b73c5c8d0b25b06e547ca2c969e1b00678772.tar.gz cubeb-701b73c5c8d0b25b06e547ca2c969e1b00678772.zip |
memory_order_relaxed has changed in c++20
-rw-r--r-- | src/cubeb_ringbuffer.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cubeb_ringbuffer.h b/src/cubeb_ringbuffer.h index b6696e8..a5416c3 100644 --- a/src/cubeb_ringbuffer.h +++ b/src/cubeb_ringbuffer.h @@ -118,8 +118,8 @@ public: assert_correct_thread(producer_id); #endif - int rd_idx = read_index_.load(std::memory_order::memory_order_relaxed); - int wr_idx = write_index_.load(std::memory_order::memory_order_relaxed); + int rd_idx = read_index_.load(std::memory_order_relaxed); + int wr_idx = write_index_.load(std::memory_order_relaxed); if (full_internal(rd_idx, wr_idx)) { return 0; @@ -142,7 +142,7 @@ public: ConstructDefault(data_.get(), second_part); } - write_index_.store(increment_index(wr_idx, to_write), std::memory_order::memory_order_release); + write_index_.store(increment_index(wr_idx, to_write), std::memory_order_release); return to_write; } @@ -163,8 +163,8 @@ public: assert_correct_thread(consumer_id); #endif - int wr_idx = write_index_.load(std::memory_order::memory_order_acquire); - int rd_idx = read_index_.load(std::memory_order::memory_order_relaxed); + int wr_idx = write_index_.load(std::memory_order_acquire); + int rd_idx = read_index_.load(std::memory_order_relaxed); if (empty_internal(rd_idx, wr_idx)) { return 0; @@ -181,7 +181,7 @@ public: Copy(elements + first_part, data_.get(), second_part); } - read_index_.store(increment_index(rd_idx, to_read), std::memory_order::memory_order_relaxed); + read_index_.store(increment_index(rd_idx, to_read), std::memory_order_relaxed); return to_read; } @@ -197,8 +197,8 @@ public: #ifndef NDEBUG assert_correct_thread(consumer_id); #endif - return available_read_internal(read_index_.load(std::memory_order::memory_order_relaxed), - write_index_.load(std::memory_order::memory_order_relaxed)); + return available_read_internal(read_index_.load(std::memory_order_relaxed), + write_index_.load(std::memory_order_relaxed)); } /** * Get the number of available elements for consuming. @@ -212,8 +212,8 @@ public: #ifndef NDEBUG assert_correct_thread(producer_id); #endif - return available_write_internal(read_index_.load(std::memory_order::memory_order_relaxed), - write_index_.load(std::memory_order::memory_order_relaxed)); + return available_write_internal(read_index_.load(std::memory_order_relaxed), + write_index_.load(std::memory_order_relaxed)); } /** * Get the total capacity, for this ring buffer. |