summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/faketime
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-05-24 13:02:40 -0700
committergVisor bot <gvisor-bot@google.com>2021-05-24 13:05:02 -0700
commitdf7c82a60c67e9188de752584b981708dd7b94d1 (patch)
tree10e3b509379372b7ef0f90d3490450cae8ba5908 /pkg/tcpip/faketime
parentb60e23a7d9a4981e5ef11228e1e24a697e96a7ad (diff)
Move RunImmediatelyScheduledJobs to faketime
Use it everywhere. PiperOrigin-RevId: 375539262
Diffstat (limited to 'pkg/tcpip/faketime')
-rw-r--r--pkg/tcpip/faketime/faketime.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/tcpip/faketime/faketime.go b/pkg/tcpip/faketime/faketime.go
index fb819d7a8..c4dbe8440 100644
--- a/pkg/tcpip/faketime/faketime.go
+++ b/pkg/tcpip/faketime/faketime.go
@@ -218,6 +218,12 @@ func (mc *ManualClock) stopTimerLocked(mt *manualTimer) {
}
}
+// RunImmediatelyScheduledJobs runs all jobs scheduled to run at the current
+// time.
+func (mc *ManualClock) RunImmediatelyScheduledJobs() {
+ mc.Advance(0)
+}
+
// Advance executes all work that have been scheduled to execute within d from
// the current time. Blocks until all work has completed execution.
func (mc *ManualClock) Advance(d time.Duration) {