]> Cypherpunks repositories - gostls13.git/commitdiff
netchan: fix dumb locking bug introduced in recent editing.
authorRob Pike <r@golang.org>
Mon, 6 Dec 2010 19:29:05 +0000 (14:29 -0500)
committerRob Pike <r@golang.org>
Mon, 6 Dec 2010 19:29:05 +0000 (14:29 -0500)
-found by Dave Cheney

R=rsc
CC=golang-dev
https://golang.org/cl/3460042

src/pkg/netchan/export.go

index 8c87ee8ce4cf3ae2931c78c67f4cbe4d1061bc91..50f9cd40b9df6e905f91f6ab89ebe877a863dcdd 100644 (file)
@@ -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