Created
February 20, 2022 12:31
-
-
Save rueian/08580c14ff88b9e8b18207c80e56c1c1 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
| type slot struct { | |
| cond sync.Cond | |
| mark uint32 | |
| req request | |
| ch chan response | |
| } | |
| func newRing() *ring { | |
| r := &ring{} | |
| for i := range r.slots { | |
| r.slots[i] = slot{ch: make(chan response, 0)} | |
| r.slots[i].cond.L = &sync.Mutex{} | |
| } | |
| return r | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment