From 17df2df75ca092342a29694739d6fbe3bf95b770 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 27 May 2021 15:09:27 -0700 Subject: 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 --- pkg/sentry/kernel/time/time.go | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'pkg/sentry/kernel') 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. // -- cgit v1.2.3