From: Rob Pike Date: Mon, 6 Dec 2010 19:29:05 +0000 (-0500) Subject: netchan: fix dumb locking bug introduced in recent editing. X-Git-Tag: weekly.2010-12-08~38 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=53eaf40ebaddf60b7b3584424219041012f28d54;p=gostls13.git netchan: fix dumb locking bug introduced in recent editing. -found by Dave Cheney R=rsc CC=golang-dev https://golang.org/cl/3460042 --- diff --git a/src/pkg/netchan/export.go b/src/pkg/netchan/export.go index 8c87ee8ce4..50f9cd40b9 100644 --- a/src/pkg/netchan/export.go +++ b/src/pkg/netchan/export.go @@ -271,6 +271,7 @@ func NewExporter(network, localaddr string) (*Exporter, os.Error) { // addClient creates a new expClient and records its existence func (exp *Exporter) addClient(conn net.Conn) *expClient { client := newClient(exp, conn) + exp.mu.Lock() exp.clients[client] = true exp.mu.Unlock() return client