-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util/timeutil: fix stopwatch for concurrent usage
Previously, it was possible to run into a race when manipulating the stop watch from one goroutine but accessing the elapsed time from another goroutine. Thus, the promise of "concurrency safe" stop watch was broken. Previously only calling Start/Stop was concurrency-safe, and now Elapsed is safe too. I'll add a unit test in a follow-up commit. Release note: None
- Loading branch information
1 parent
9042fd6
commit 90ccee9
Showing
1 changed file
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters