Created
February 4, 2022 09:28
-
-
Save rueian/b2cb324c15f8a2571401e06b20c9a820 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func (r *ring) NextRequestToSend() (req request, ok bool) { | |
| s := &r.slots[(r.read1+1)&1023] | |
| if ok = atomic.LoadUint32(&s.mark) == 2; ok { | |
| req = s.req | |
| r.read1++ | |
| atomic.StoreUint32(&s.mark, 3) | |
| } | |
| return | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment