Skip to content

Commit

Permalink
runtime, time: remove old timer code
Browse files Browse the repository at this point in the history
Updates #6239
Updates #27707

Change-Id: I65e6471829c9de4677d3ac78ef6cd7aa0a1fc4cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/171884
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
  • Loading branch information
ianlancetaylor committed Nov 19, 2019
1 parent 8cf5293 commit 580337e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 408 deletions.
49 changes: 14 additions & 35 deletions src/runtime/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4410,44 +4410,23 @@ func checkdead() {
}

// Maybe jump time forward for playground.
if oldTimers {
gp := timejumpOld()
if gp != nil {
casgstatus(gp, _Gwaiting, _Grunnable)
globrunqput(gp)
_p_ := pidleget()
if _p_ == nil {
throw("checkdead: no p for timer")
}
mp := mget()
if mp == nil {
// There should always be a free M since
// nothing is running.
throw("checkdead: no m for timer")
_p_ := timejump()
if _p_ != nil {
for pp := &sched.pidle; *pp != 0; pp = &(*pp).ptr().link {
if (*pp).ptr() == _p_ {
*pp = _p_.link
break
}
mp.nextp.set(_p_)
notewakeup(&mp.park)
return
}
} else {
_p_ := timejump()
if _p_ != nil {
for pp := &sched.pidle; *pp != 0; pp = &(*pp).ptr().link {
if (*pp).ptr() == _p_ {
*pp = _p_.link
break
}
}
mp := mget()
if mp == nil {
// There should always be a free M since
// nothing is running.
throw("checkdead: no m for timer")
}
mp.nextp.set(_p_)
notewakeup(&mp.park)
return
mp := mget()
if mp == nil {
// There should always be a free M since
// nothing is running.
throw("checkdead: no m for timer")
}
mp.nextp.set(_p_)
notewakeup(&mp.park)
return
}

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

0 comments on commit 580337e

Please sign in to comment.