diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-04-05 16:24:14 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2019-10-21 17:23:42 +0000 |
commit | 06ac26279cb93140bb2b03bcef9a3300c166cade (patch) | |
tree | a9890a3dae8d1d031b22fb82bb1ec0bdda5c628b /src/runtime/time.go | |
parent | ff9f7bc9da45b66689d8e61b6c674b555517de20 (diff) | |
download | go-06ac26279cb93140bb2b03bcef9a3300c166cade.tar.gz go-06ac26279cb93140bb2b03bcef9a3300c166cade.zip |
runtime: initial scheduler changes for timers on P's
Add support to the main scheduler loop for handling timers on P's.
This is not used yet, as timers are not yet put on P's.
Updates #6239
Updates #27707
Change-Id: I6a359df408629f333a9232142ce19e8be8496dae
Reviewed-on: https://go-review.googlesource.com/c/go/+/171826
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/time.go')
-rw-r--r-- | src/runtime/time.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/runtime/time.go b/src/runtime/time.go index 5521b8a807..1bbb5684cb 100644 --- a/src/runtime/time.go +++ b/src/runtime/time.go @@ -325,6 +325,27 @@ func timerproc(tb *timersBucket) { } } +// adjusttimers looks through the timers in the current P's heap for +// any timers that have been modified to run earlier, and puts them in +// the correct place in the heap. +// The caller must have locked the timers for pp. +func adjusttimers(pp *p) { + if len(pp.timers) == 0 { + return + } + throw("adjusttimers: not yet implemented") +} + +// runtimer examines the first timer in timers. If it is ready based on now, +// it runs the timer and removes or updates it. +// Returns 0 if it ran a timer, -1 if there are no more timers, or the time +// when the first timer should run. +// The caller must have locked the timers for pp. +func runtimer(pp *p, now int64) int64 { + throw("runtimer: not yet implemented") + return -1 +} + func timejump() *g { if faketime == 0 { return nil |