Last active
February 6, 2022 11:34
-
-
Save rueian/95330036253b9f12b8c9b638222915a4 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) ReplyToNextRequest(resp response) { | |
| r.read2++ | |
| s := &r.slots[r.read2&1023] | |
| if atomic.LoadUint32(&s.mark) != 3 { | |
| panic("out-of-band response should not be passed in") | |
| } | |
| s.ch <- resp // this should be a non-buffered channel | |
| atomic.StoreUint32(&s.mark, 0) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment