1
0
mirror of https://github.com/golang/sync synced 2020-06-03 17:03:44 +00:00
sync/singleflight
LE Manh Cuong 56d357773e singleflight: fix duplicate deleting key when Forget called
When Forget was called, we delete key associated with current call from
map. When that call is done, it does delete key again, causing the same
key set by other call after Forget lost.

To fix it, adding a boolean value to check whether the call is forgotten,
the call only does delete key if Forget is not called.

Fixes golang/go#31420

Change-Id: I9708352ca3ff76c77f659916b37a496fdeb480d2
Reviewed-on: https://go-review.googlesource.com/c/sync/+/171897
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-12 18:36:30 +00:00
..
singleflight_test.go singleflight: fix duplicate deleting key when Forget called 2019-04-12 18:36:30 +00:00
singleflight.go singleflight: fix duplicate deleting key when Forget called 2019-04-12 18:36:30 +00:00