diff options
Diffstat (limited to 'libgo/go/context/context.go')
-rw-r--r-- | libgo/go/context/context.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/context/context.go b/libgo/go/context/context.go index 06580e0465a..1b4fa41b8cc 100644 --- a/libgo/go/context/context.go +++ b/libgo/go/context/context.go @@ -334,8 +334,9 @@ func (c *cancelCtx) Done() <-chan struct{} { func (c *cancelCtx) Err() error { c.mu.Lock() - defer c.mu.Unlock() - return c.err + err := c.err + c.mu.Unlock() + return err } func (c *cancelCtx) String() string { |