diff options
| author | Ian Lance Taylor <iant@golang.org> | 2024-09-06 17:19:34 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-09-26 22:39:10 +0000 |
| commit | 2ebaff4890596ed6064e2dcbbe5e68bc93bed882 (patch) | |
| tree | 481ba1fd918c5c33e5d7224b3ff5b69f93ea5af0 /src/runtime/runtime-gdb_test.go | |
| parent | 35874308993d5dbb3a618254babb5c1fa85bd1e3 (diff) | |
| download | go-2ebaff4890596ed6064e2dcbbe5e68bc93bed882.tar.xz | |
runtime: if stop/reset races with running timer, return correct result
The timer code is careful to ensure that if stop/reset is called
while a timer is being run, we cancel the run. However, the code
failed to ensure that in that case stop/reset returned true,
meaning that the timer had been stopped. In the racing case
stop/reset could see that t.when had been set to zero,
and return false, even though the timer had not and never would fire.
Fix this by tracking whether a timer run is in progress,
and using that to reliably detect that the run was cancelled,
meaning that stop/reset should return true.
Fixes #69312
Change-Id: I78e870063eb96650638f12c056e32c931417c84a
Reviewed-on: https://go-review.googlesource.com/c/go/+/611496
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/runtime-gdb_test.go')
0 files changed, 0 insertions, 0 deletions
