Sha256: b6bd15937ae2ab45ebd46cb06981244e8e5e75ea0c47e6d8d294a00ba9003f0e

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

#![cfg_attr(not(feature = "rt"), allow(dead_code))]

//! Process driver.

use crate::process::unix::GlobalOrphanQueue;
use crate::runtime::driver;
use crate::runtime::signal::{Driver as SignalDriver, Handle as SignalHandle};

use std::time::Duration;

/// Responsible for cleaning up orphaned child processes on Unix platforms.
#[derive(Debug)]
pub(crate) struct Driver {
    park: SignalDriver,
    signal_handle: SignalHandle,
}

// ===== impl Driver =====

impl Driver {
    /// Creates a new signal `Driver` instance that delegates wakeups to `park`.
    pub(crate) fn new(park: SignalDriver) -> Self {
        let signal_handle = park.handle();

        Self {
            park,
            signal_handle,
        }
    }

    pub(crate) fn park(&mut self, handle: &driver::Handle) {
        self.park.park(handle);
        GlobalOrphanQueue::reap_orphans(&self.signal_handle);
    }

    pub(crate) fn park_timeout(&mut self, handle: &driver::Handle, duration: Duration) {
        self.park.park_timeout(handle, duration);
        GlobalOrphanQueue::reap_orphans(&self.signal_handle);
    }

    pub(crate) fn shutdown(&mut self, handle: &driver::Handle) {
        self.park.shutdown(handle);
    }
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/process.rs
wasmtime-28.0.0 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/process.rs
wasmtime-27.0.0 ./ext/cargo-vendor/tokio-1.41.1/src/runtime/process.rs
wasmtime-26.0.0 ./ext/cargo-vendor/tokio-1.41.0/src/runtime/process.rs
wasmtime-25.0.2 ./ext/cargo-vendor/tokio-1.40.0/src/runtime/process.rs
wasmtime-25.0.1 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/process.rs
wasmtime-25.0.0 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/process.rs
wasmtime-24.0.0 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/process.rs
wasmtime-23.0.2 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/process.rs
wasmtime-22.0.0 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/process.rs
wasmtime-21.0.1 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/process.rs
wasmtime-20.0.2 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/process.rs
wasmtime-20.0.0 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/process.rs
wasmtime-18.0.3 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/process.rs
wasmtime-17.0.1 ./ext/cargo-vendor/tokio-1.35.1/src/runtime/process.rs
wasmtime-17.0.0 ./ext/cargo-vendor/tokio-1.35.1/src/runtime/process.rs
wasmtime-16.0.0 ./ext/cargo-vendor/tokio-1.35.1/src/runtime/process.rs
wasmtime-15.0.1 ./ext/cargo-vendor/tokio-1.35.1/src/runtime/process.rs
wasmtime-15.0.0 ./ext/cargo-vendor/tokio-1.35.1/src/runtime/process.rs