]> Cypherpunks repositories - gostls13.git/commit
runtime: leave cleantimers early if G is being preempted
authorIan Lance Taylor <iant@golang.org>
Thu, 12 Mar 2020 05:03:50 +0000 (22:03 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 12 Mar 2020 23:17:02 +0000 (23:17 +0000)
commit5d70cb066756369f99be6ffa69b639626d95e647
treee1938cdd31a48165d9eb9a788aa2ac6427439e3b
parent29b36a88ab0b179c140612e7c907042b2a388587
runtime: leave cleantimers early if G is being preempted

The cleantimers can run for a while in some unlikely cases.
If the GC is trying to preempt the G, it is forced to wait as the
G is holding timersLock. To avoid introducing a GC delay,
return from cleantimers if the G has a preemption request.

Fixes #37779

Change-Id: Id9a567f991e26668e2292eefc39e2edc56efa4e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/223122
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/time.go