pub struct Watchdog { /* private fields */ }Expand description
The per-execute timeout timer with a movable deadline.
Created by the kernel when a script timeout is in effect, shared with
every ExecContext snapshot of that execution (and its forks) so builtins
can acquire patient holds against it.
Implementations§
Source§impl Watchdog
impl Watchdog
Sourcepub async fn run(
self: Arc<Self>,
elapsed: Arc<AtomicBool>,
token: CancellationToken,
)
pub async fn run( self: Arc<Self>, elapsed: Arc<AtomicBool>, token: CancellationToken, )
Timer task body: sleep toward the current deadline, re-arming whenever
a patient hold moves it. When the deadline is genuinely reached, set
elapsed (so the kernel maps the result to exit 124) and fire token.
Sourcepub fn hold(self: &Arc<Self>, budget: Duration) -> WatchdogHold
pub fn hold(self: &Arc<Self>, budget: Duration) -> WatchdogHold
Suspend the active regime: freeze its remaining time and let budget
govern the deadline until the hold drops.
Auto Trait Implementations§
impl !Freeze for Watchdog
impl RefUnwindSafe for Watchdog
impl Send for Watchdog
impl Sync for Watchdog
impl Unpin for Watchdog
impl UnsafeUnpin for Watchdog
impl UnwindSafe for Watchdog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more