]> Cypherpunks repositories - gostls13.git/commit
net/rpc: avoid racy use of closing flag.
authorRoger Peppe <rogpeppe@gmail.com>
Mon, 25 Feb 2013 16:22:00 +0000 (16:22 +0000)
committerRoger Peppe <rogpeppe@gmail.com>
Mon, 25 Feb 2013 16:22:00 +0000 (16:22 +0000)
commit7edd13355f1a407a95c7a084c201867501f48ec6
tree87e3ef61ebfe2c285b4c4cc338a9c330b7fb4d68
parentcd81db82995a7e91c1c0184ad6afc1b4d8354471
net/rpc: avoid racy use of closing flag.

It's accessed without mutex protection
in a different goroutine from the one that
sets it.

Also make sure that Client.Call after Client.Close
will reliably return ErrShutdown, and that clients
see ErrShutdown rather than io.EOF when appropriate.

Suggestions welcome for a way to reliably test
the mutex issue.

R=r, iant
CC=golang-dev
https://golang.org/cl/7338045
src/pkg/net/rpc/client.go
src/pkg/net/rpc/server_test.go