mirror of
https://github.com/golang/go.git
synced 2025-05-29 11:25:43 +00:00
runtime: never allocate new M when jumping time forward
When we're jumping time forward, it means everyone is asleep, so there should always be an M available. Furthermore, this causes both allocation and write barriers in contexts that may be running without a P (such as in sysmon). Hence, replace this allocation with a throw. Updates #10600. Change-Id: I2cee70d5db828d0044082878995949edb25dda5f Reviewed-on: https://go-review.googlesource.com/16815 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
f5c42cf88e
commit
f32f2954fb
@ -3274,11 +3274,12 @@ func checkdead() {
|
|||||||
}
|
}
|
||||||
mp := mget()
|
mp := mget()
|
||||||
if mp == nil {
|
if mp == nil {
|
||||||
newm(nil, _p_)
|
// There should always be a free M since
|
||||||
} else {
|
// nothing is running.
|
||||||
mp.nextp.set(_p_)
|
throw("checkdead: no m for timer")
|
||||||
notewakeup(&mp.park)
|
|
||||||
}
|
}
|
||||||
|
mp.nextp.set(_p_)
|
||||||
|
notewakeup(&mp.park)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user