1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:34:40 -07:00

netchan: fix dumb locking bug introduced in recent editing.

-found by Dave Cheney

R=rsc
CC=golang-dev
https://golang.org/cl/3460042
This commit is contained in:
Rob Pike 2010-12-06 14:29:05 -05:00
parent e26f9b3420
commit 53eaf40eba

View 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