mirror of
https://github.com/golang/go
synced 2024-11-25 07:07:57 -07:00
old/netchan: fix data race on client hashmap
Fixes #2713. R=golang-dev, r CC=golang-dev, mpimenov https://golang.org/cl/5545065
This commit is contained in:
parent
994e0646d8
commit
8e99016c80
@ -165,9 +165,11 @@ func (cs *clientSet) sync(timeout time.Duration) error {
|
||||
deadline := time.Now().Add(timeout)
|
||||
// seq remembers the clients and their seqNum at point of entry.
|
||||
seq := make(map[unackedCounter]int64)
|
||||
cs.mu.Lock()
|
||||
for client := range cs.clients {
|
||||
seq[client] = client.seq()
|
||||
}
|
||||
cs.mu.Unlock()
|
||||
for {
|
||||
pending := false
|
||||
cs.mu.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user