summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2014-10-13 10:27:51 -0700
committerRob Pike <r@golang.org>2014-10-13 10:27:51 -0700
commit9d7d1d8b2867d2ce6ef44441d9d26970e3e27ce9 (patch)
tree2727378dd6062bc7d452baca0dd1348e524f496a /src/net
parentde92dd92e818cf8f79c589e0154a2da08106d032 (diff)
downloadgo-9d7d1d8b2867d2ce6ef44441d9d26970e3e27ce9.tar.gz
net/rpc: fix mutex comment
Fixes issue 8086. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://codereview.appspot.com/153420044
Diffstat (limited to 'src/net')
-rw-r--r--src/net/rpc/client.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/rpc/client.go b/src/net/rpc/client.go
index 21f79b068..d0c4a6921 100644
--- a/src/net/rpc/client.go
+++ b/src/net/rpc/client.go
@@ -41,10 +41,10 @@ type Call struct {
type Client struct {
codec ClientCodec
- sending sync.Mutex
+ reqMutex sync.Mutex // protects following
+ request Request
mutex sync.Mutex // protects following
- request Request
seq uint64
pending map[uint64]*Call
closing bool // user has called Close
@@ -69,8 +69,8 @@ type ClientCodec interface {
}
func (client *Client) send(call *Call) {
- client.sending.Lock()
- defer client.sending.Unlock()
+ client.reqMutex.Lock()
+ defer client.reqMutex.Unlock()
// Register this call.
client.mutex.Lock()
@@ -146,7 +146,7 @@ func (client *Client) input() {
}
}
// Terminate pending calls.
- client.sending.Lock()
+ client.reqMutex.Lock()
client.mutex.Lock()
client.shutdown = true
closing := client.closing
@@ -162,7 +162,7 @@ func (client *Client) input() {
call.done()
}
client.mutex.Unlock()
- client.sending.Unlock()
+ client.reqMutex.Unlock()
if debugLog && err != io.EOF && !closing {
log.Println("rpc: client protocol error:", err)
}