Skip to content

Commit

Permalink
Fix memory ordering in lifo_queue put
Browse files Browse the repository at this point in the history
  • Loading branch information
maikel committed Nov 1, 2023
1 parent 3a0439c commit 3fa86e9
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 @@ -375,7 +375,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 3fa86e9

Please sign in to comment.