From 25798f214c6d1991916906ea8fca9e7029a8c423 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Mon, 3 Aug 2020 22:06:46 -0700 Subject: Add callbacks to support lazy loading/restoring thread states PiperOrigin-RevId: 324748508 --- pkg/sentry/kernel/kernel.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/sentry/kernel/kernel.go') diff --git a/pkg/sentry/kernel/kernel.go b/pkg/sentry/kernel/kernel.go index 316df249d..1028d13c6 100644 --- a/pkg/sentry/kernel/kernel.go +++ b/pkg/sentry/kernel/kernel.go @@ -1263,6 +1263,13 @@ func (k *Kernel) Pause() { k.tasks.aioGoroutines.Wait() } +// ReceiveTaskStates receives full states for all tasks. +func (k *Kernel) ReceiveTaskStates() { + k.extMu.Lock() + k.tasks.PullFullState() + k.extMu.Unlock() +} + // Unpause ends the effect of a previous call to Pause. If Unpause is called // without a matching preceding call to Pause, Unpause may panic. func (k *Kernel) Unpause() { -- cgit v1.2.3