We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c17e3f commit 1fa9eaeCopy full SHA for 1fa9eae
1 file changed
util/lockfree_fifo_spsc.hh
@@ -115,6 +115,13 @@ public:
115
tail_.store(pos, std::memory_order_release);
116
}
117
118
+ // Sets read head `offset` samples before write head, if possible
119
+ void set_read_offset(size_t offset) {
120
+ auto head = head_.load(std::memory_order_acquire);
121
+ if (offset <= head)
122
+ tail_.store(head - offset, std::memory_order_release);
123
+ }
124
+
125
void set_write_pos(size_t pos) {
126
head_.store(pos, std::memory_order_release);
127
0 commit comments