pub(crate) fn should_stop() -> bool {
        std::thread::panicking()
            || Self::with(|s| {
                assert_ne!(s.current_task, ScheduledTask::Finished);
                s.current_task == ScheduledTask::Stopped
            })
    }
/// Check whether the current execution has stopped. Call from `Drop` handlers to early exit if
/// they are being invoked because an execution has stopped.
///
/// We also stop if we are currently panicking (e.g., perhaps we're unwinding the stack for a
/// panic triggered while someone held a Mutex, and so are executing the Drop handler for
/// MutexGuard). This avoids calling back into the scheduler during a panic, because the state
/// may be poisoned or otherwise invalid.
Check whether the current execution has stopped. Call from `Drop` handlers to early exit if
they are being invoked because an execution has stopped.

We also stop if we are currently panicking . This avoids calling back into the scheduler during a panic, because the state
may be poisoned or otherwise invalid.
Check whether the current execution has stopped . Call from ` Drop ` handlers to early exit if they are being invoked because an execution has stopped . We also stop if we are currently panicking . This avoids calling back into the scheduler during a panic because the state may be poisoned or otherwise invalid .
pub(crate) fn should_stop() -> bool {
        std::thread::panicking()
            || Self::with(|s| {
                assert_ne!(s.current_task, ScheduledTask::Finished);
                s.current_task == ScheduledTask::Stopped
            })
    }
pub ( crate ) fn should_stop ( ) -> bool { std :: thread :: panicking ( ) || Self :: with ( | s | { assert_ne ! ( s current_task ScheduledTask Finished ) ; s . current_task == ScheduledTask :: Stopped } ) }
Check whether the current execution has stopped.
Check whether the current execution has stopped .