summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-10 17:43:16 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-10 17:43:16 -0700
commit508e7c3a792d56b87e54b530145968aee85ead87 (patch)
tree441ab33caf8b6910352db63652b4ec0ca1938ddc /pkg/sentry/kernel
parentab4c85189313097dbac5d5531f9ff6a08d9ba289 (diff)
parentf1f85f475d5f98ad9e9d574a11997c0829c3b189 (diff)
Merge pull request #2763 from gaurav1086:sentry_kernel_timekeeper_use_buffered_channel
PiperOrigin-RevId: 315803553
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/timekeeper.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/timekeeper.go b/pkg/sentry/kernel/timekeeper.go
index da0ea7bb5..0adf25691 100644
--- a/pkg/sentry/kernel/timekeeper.go
+++ b/pkg/sentry/kernel/timekeeper.go
@@ -186,6 +186,7 @@ func (t *Timekeeper) startUpdater() {
timer := time.NewTicker(sentrytime.ApproxUpdateInterval)
t.wg.Add(1)
go func() { // S/R-SAFE: stopped during save.
+ defer t.wg.Done()
for {
// Start with an update immediately, so the clocks are
// ready ASAP.
@@ -220,7 +221,6 @@ func (t *Timekeeper) startUpdater() {
select {
case <-timer.C:
case <-t.stop:
- t.wg.Done()
return
}
}