pub struct Watchdog { /* private fields */ }Expand description
Opt-in main-thread hang detector.
The watchdog is disabled by default and costs one sleeping thread that wakes every
WatchdogOptions::interval. At the default five-second interval this is 12 wakeups per
minute and no allocation; enable it only when hang telemetry is worth that idle cost.
Implementations§
Source§impl Watchdog
impl Watchdog
Sourcepub fn start(reporter: &CrashReporter, options: WatchdogOptions) -> Result<Self>
pub fn start(reporter: &CrashReporter, options: WatchdogOptions) -> Result<Self>
Start the monitor thread. The caller must call Watchdog::heartbeat from the thread
whose responsiveness is being observed.
Sourcepub fn reported_hang(&self) -> bool
pub fn reported_hang(&self) -> bool
Whether the watchdog has already written a hang report for the current stall.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Watchdog
impl !UnwindSafe for Watchdog
impl Forget for Watchdog
impl Freeze for Watchdog
impl Move for Watchdog
impl Send for Watchdog
impl Sync for Watchdog
impl Unpin for Watchdog
impl UnsafeUnpin 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