]> Cypherpunks repositories - gostls13.git/commitdiff
net/rpc: unlock client.mutex as early as possible
authorchanxuehong <chanxuehong@gmail.com>
Fri, 6 Apr 2018 14:05:01 +0000 (14:05 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 6 Apr 2018 14:47:39 +0000 (14:47 +0000)
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 <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/rpc/client.go

index fce6a4866c98f1097137e531dda189287f6dd99e..f3da3ae3ee9ed4413158aa9505cf183ef24df1cb 100644 (file)
@@ -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
        }