From bd302502d39b6172bf3db6abfa49fdcaa124ee50 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 14 Jul 2022 17:36:59 -0400 Subject: runtime: convert panicking to atomic type For #53821. Change-Id: I93409f377881a3c029b41b0f1fbcef5e21091f2f Reviewed-on: https://go-review.googlesource.com/c/go/+/419438 Reviewed-by: Austin Clements Run-TryBot: Michael Pratt TryBot-Result: Gopher Robot --- src/runtime/proc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/proc.go') diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 33219419f9..33d7d6f552 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -265,7 +265,7 @@ func main() { Gosched() } } - if atomic.Load(&panicking) != 0 { + if panicking.Load() != 0 { gopark(nil, nil, waitReasonPanicWait, traceEvGoStop, 1) } @@ -5016,7 +5016,7 @@ func checkdead() { // freezetheworld will cause all running threads to block. // And runtime will essentially enter into deadlock state, // except that there is a thread that will call exit soon. - if panicking > 0 { + if panicking.Load() > 0 { return } -- cgit v1.3-5-g9baa