Commit graph

2 commits

Author SHA1 Message Date
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
Matt Layher
1ae7c7b29e singleflight: copy from internal/singleflight in standard library
Updates golang/go#17338

Change-Id: Icf1972cdec0bbc9b3142141d9e706c07f312efc0
Reviewed-on: https://go-review.googlesource.com/30292
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-04 23:36:20 +00:00