From 8e99016c80ee8c113674654123a02f0bd9e32ebb Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Tue, 17 Jan 2012 11:48:20 +0400 Subject: [PATCH] old/netchan: fix data race on client hashmap Fixes #2713. R=golang-dev, r CC=golang-dev, mpimenov https://golang.org/cl/5545065 --- src/pkg/old/netchan/common.go | 2 ++ 1 file changed, 2 insertions(+) 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() -- 2.48.1