Skip to content

Commit 409b452

Browse files
EasonNYCeason-gif
andauthored
Fix RingBuffer::push() loading wrong atomic index (#697)
Co-authored-by: Eason Smith <eason@treeswift.com>
1 parent 9d2132d commit 409b452

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ouster_client/include/ouster/impl/ring_buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class RingBuffer {
148148
if (full()) {
149149
throw std::overflow_error("pushed a full ring buffer");
150150
}
151-
size_t write_idx = r_idx_.load();
151+
size_t write_idx = w_idx_.load();
152152
// atomic increment modulo
153153
while (!w_idx_.compare_exchange_strong(write_idx,
154154
(write_idx + 1) % _capacity())) {

0 commit comments

Comments
 (0)