Skip to content

Commit 580337e

Browse files
runtime, time: remove old timer code
Updates #6239 Updates #27707 Change-Id: I65e6471829c9de4677d3ac78ef6cd7aa0a1fc4cb Reviewed-on: https://go-review.googlesource.com/c/go/+/171884 Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]>
1 parent 8cf5293 commit 580337e

File tree

4 files changed

+19
-408
lines changed

4 files changed

+19
-408
lines changed

src/runtime/proc.go

+14-35
Original file line numberDiff line numberDiff line change
@@ -4410,44 +4410,23 @@ func checkdead() {
44104410
}
44114411

44124412
// Maybe jump time forward for playground.
4413-
if oldTimers {
4414-
gp := timejumpOld()
4415-
if gp != nil {
4416-
casgstatus(gp, _Gwaiting, _Grunnable)
4417-
globrunqput(gp)
4418-
_p_ := pidleget()
4419-
if _p_ == nil {
4420-
throw("checkdead: no p for timer")
4421-
}
4422-
mp := mget()
4423-
if mp == nil {
4424-
// There should always be a free M since
4425-
// nothing is running.
4426-
throw("checkdead: no m for timer")
4413+
_p_ := timejump()
4414+
if _p_ != nil {
4415+
for pp := &sched.pidle; *pp != 0; pp = &(*pp).ptr().link {
4416+
if (*pp).ptr() == _p_ {
4417+
*pp = _p_.link
4418+
break
44274419
}
4428-
mp.nextp.set(_p_)
4429-
notewakeup(&mp.park)
4430-
return
44314420
}
4432-
} else {
4433-
_p_ := timejump()
4434-
if _p_ != nil {
4435-
for pp := &sched.pidle; *pp != 0; pp = &(*pp).ptr().link {
4436-
if (*pp).ptr() == _p_ {
4437-
*pp = _p_.link
4438-
break
4439-
}
4440-
}
4441-
mp := mget()
4442-
if mp == nil {
4443-
// There should always be a free M since
4444-
// nothing is running.
4445-
throw("checkdead: no m for timer")
4446-
}
4447-
mp.nextp.set(_p_)
4448-
notewakeup(&mp.park)
4449-
return
4421+
mp := mget()
4422+
if mp == nil {
4423+
// There should always be a free M since
4424+
// nothing is running.
4425+
throw("checkdead: no m for timer")
44504426
}
4427+
mp.nextp.set(_p_)
4428+
notewakeup(&mp.park)
4429+
return
44514430
}
44524431

44534432
// There are no goroutines running, so we can look at the P's.

0 commit comments

Comments
 (0)