Skip to content

Commit

Permalink
Merge pull request #1129 from maikel/improve-bwos-lifo-queue
Browse files Browse the repository at this point in the history
Fix memory ordering in lifo_queue put
  • Loading branch information
ericniebler authored Nov 2, 2023
2 parents f786cbf + 3fa86e9 commit 3324fd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/exec/__detail/__bwos_lifo_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ namespace exec::bwos {
std::uint64_t back = tail_.load(std::memory_order_relaxed);
if (back < block_size()) [[likely]] {
ring_buffer_[back] = static_cast<Tp &&>(value);
tail_.store(back + 1, std::memory_order_relaxed);
tail_.store(back + 1, std::memory_order_release);
return lifo_queue_error_code::success;
}
return lifo_queue_error_code::full;
Expand Down

0 comments on commit 3324fd5

Please sign in to comment.