We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wi = 10, ri = 0, size = 10, item = y, buffer[0] = x.
y is returned even though x should have been, or sub should have moved to next.
The text was updated successfully, but these errors were encountered:
Change the check in sub 3.a to if wi >= ri + size => ri = wi - size + 1;
if self.wi() > self.ri() + self.size { self.ri.store(self.wi() - self.size, Ordering::Relaxed); }
if self.wi() >= self.ri() + self.size { self.ri.store(self.wi() - self.size + 1, Ordering::Relaxed); }
wi == 10, ri == 0, size == 10, item == y, buffer[0] == x, buffer[1] = z;
next value is returned, even if wi is incremented at any point the check at sub.3.a would catch it.
Sorry, something went wrong.
No branches or pull requests
Publisher operations during broadcast
Subscriber operations during try_recv
3.a. if wi > ri + size => ri = wi - size;
3.b. else => ri++, return item
Test Case
wi = 10, ri = 0, size = 10, item = y, buffer[0] = x.
y is returned even though x should have been, or sub should have moved to next.
The text was updated successfully, but these errors were encountered: