diff options
author | Andrei Vagin <avagin@google.com> | 2021-05-27 15:09:27 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-27 15:11:49 -0700 |
commit | 17df2df75ca092342a29694739d6fbe3bf95b770 (patch) | |
tree | 7f12b06de93f1057d74f773bad886c08b10ba8e9 /pkg/sentry/kernel/time | |
parent | dd2e1f07a9c0dddcdfd5f983fc338938a4b11935 (diff) |
nanosleep has to store the finish time in the restart block
nanosleep has to count time that a thread spent in the stopped state.
PiperOrigin-RevId: 376258641
Diffstat (limited to 'pkg/sentry/kernel/time')
-rw-r--r-- | pkg/sentry/kernel/time/time.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/pkg/sentry/kernel/time/time.go b/pkg/sentry/kernel/time/time.go index f61a8e164..26aa34aa6 100644 --- a/pkg/sentry/kernel/time/time.go +++ b/pkg/sentry/kernel/time/time.go @@ -458,25 +458,6 @@ func NewTimer(clock Clock, listener TimerListener) *Timer { return t } -// After waits for the duration to elapse according to clock and then sends a -// notification on the returned channel. The timer is started immediately and -// will fire exactly once. The second return value is the start time used with -// the duration. -// -// Callers must call Timer.Destroy. -func After(clock Clock, duration time.Duration) (*Timer, Time, <-chan struct{}) { - notifier, tchan := NewChannelNotifier() - t := NewTimer(clock, notifier) - now := clock.Now() - - t.Swap(Setting{ - Enabled: true, - Period: 0, - Next: now.Add(duration), - }) - return t, now, tchan -} - // init initializes Timer state that is not preserved across save/restore. If // init has already been called, calling it again is a no-op. // |