From: chanxuehong Date: Fri, 6 Apr 2018 14:05:01 +0000 (+0000) Subject: net/rpc: unlock client.mutex as early as possible X-Git-Tag: go1.11beta1~944 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=92c29ef94116f64263444a07748192b3857be9f1;p=gostls13.git net/rpc: unlock client.mutex as early as possible Although these changes have no essential influence, I think this is a better point. Change-Id: I571d3a14c948d2fd7bc9561f47f33e9e4c90683f GitHub-Last-Rev: d8c5d180069bb91b6eb1247769bd14f728922fc0 GitHub-Pull-Request: golang/go#24697 Reviewed-on: https://go-review.googlesource.com/104895 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/net/rpc/client.go b/src/net/rpc/client.go index fce6a4866c..f3da3ae3ee 100644 --- a/src/net/rpc/client.go +++ b/src/net/rpc/client.go @@ -75,8 +75,8 @@ func (client *Client) send(call *Call) { // Register this call. client.mutex.Lock() if client.shutdown || client.closing { - call.Error = ErrShutdown client.mutex.Unlock() + call.Error = ErrShutdown call.done() return }