wasmer_wasix/syscalls/journal/
do_checkpoint_from_outside.rs

1use crate::os::task::process::LockableWasiProcessInner;
2
3use super::WasiProcessCheckpoint;
4
5pub(crate) fn do_checkpoint_from_outside(
6    process: &LockableWasiProcessInner,
7    checkpoint: WasiProcessCheckpoint,
8) {
9    let mut guard = process.0.lock().unwrap();
10
11    // Initiate the checksum (if one already exists we must wait for it to end
12    // before we start the next checksum)
13
14    // TODO: Disabled as this blocks the async runtime
15    //while !matches!(guard.checkpoint, WasiProcessCheckpoint::Execute) {
16    //    guard = process.1.wait(guard).unwrap();
17    //}
18
19    guard.checkpoint = checkpoint;
20    for waker in guard.wakers.drain(..) {
21        waker.wake();
22    }
23    process.1.notify_all();
24}