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:
Dmitriy Vyukov 2012-01-17 11:48:20 +04:00
parent 994e0646d8
commit 8e99016c80

View file

@ -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()