runtime: dump the status of lockedg on error

When lockedg's status is bad, it will be helpful to dump the bad
status. Besides, dumpgstatus() will dump current g anyway, it's
more helpful to dump lockedg as well than dumping current g twice.
This commit is contained in:
Tiwei Bie 2020-07-16 23:53:52 +08:00
parent c5d7f2f1cb
commit da814c51ff
1 changed files with 2 additions and 2 deletions

View File

@ -2039,8 +2039,8 @@ func stoplockedm() {
noteclear(&_g_.m.park)
status := readgstatus(_g_.m.lockedg.ptr())
if status&^_Gscan != _Grunnable {
print("runtime:stoplockedm: g is not Grunnable or Gscanrunnable\n")
dumpgstatus(_g_)
print("runtime:stoplockedm: lockedg (atomicstatus=", status, ") is not Grunnable or Gscanrunnable\n")
dumpgstatus(_g_.m.lockedg.ptr())
throw("stoplockedm: not runnable")
}
acquirep(_g_.m.nextp.ptr())