From: Dmitriy Vyukov Date: Tue, 17 Jan 2012 07:48:20 +0000 (+0400) Subject: old/netchan: fix data race on client hashmap X-Git-Tag: weekly.2012-01-20~86 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8e99016c80ee8c113674654123a02f0bd9e32ebb;p=gostls13.git old/netchan: fix data race on client hashmap Fixes #2713. R=golang-dev, r CC=golang-dev, mpimenov https://golang.org/cl/5545065 --- diff --git a/src/pkg/old/netchan/common.go b/src/pkg/old/netchan/common.go index 710b63ac50..d0daf53720 100644 --- a/src/pkg/old/netchan/common.go +++ b/src/pkg/old/netchan/common.go @@ -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()