]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add world-stopped assertions
authorMichael Pratt <mpratt@google.com>
Wed, 28 Oct 2020 22:06:05 +0000 (18:06 -0400)
committerMichael Pratt <mpratt@google.com>
Fri, 30 Oct 2020 20:20:58 +0000 (20:20 +0000)
commit6abbfc17c255c07134a69c3ca305231db80530ec
tree0c63ed03f28c20d9927ee8c4352ba0d16f76cb99
parent94b3fd06cb431358f45786246cd279c8bdb9370b
runtime: add world-stopped assertions

Stopping the world is an implicit lock for many operations, so we should
assert the world is stopped in functions that require it.

This is enabled along with the rest of lock ranking, though it is a bit
orthogonal and likely cheap enough to enable all the time should we
choose.

Requiring a lock _or_ world stop is common, so that can be expressed as
well.

Updates #40677

Change-Id: If0a58544f4251d367f73c4120c9d39974c6cd091
Reviewed-on: https://go-review.googlesource.com/c/go/+/248577
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Michael Pratt <mpratt@google.com>
src/runtime/heapdump.go
src/runtime/lockrank_off.go
src/runtime/lockrank_on.go
src/runtime/mcheckmark.go
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/mgcsweep.go
src/runtime/mstats.go
src/runtime/proc.go