aboutsummaryrefslogtreecommitdiff
path: root/singleflight/singleflight.go
diff options
context:
space:
mode:
Diffstat (limited to 'singleflight/singleflight.go')
-rw-r--r--singleflight/singleflight.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/singleflight/singleflight.go b/singleflight/singleflight.go
index 7c7fc50..8473fb7 100644
--- a/singleflight/singleflight.go
+++ b/singleflight/singleflight.go
@@ -144,9 +144,9 @@ func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) {
c.err = errGoexit
}
- c.wg.Done()
g.mu.Lock()
defer g.mu.Unlock()
+ c.wg.Done()
if g.m[key] == c {
delete(g.m, key)
}