Skip to main content

probe_lock

Function probe_lock 

Source
fn probe_lock() -> &'static Mutex<()>
Expand description

Process-wide lock serializing every probe() call. std::panic::set_hook / take_hook are global, process-wide state, not thread-local - without this, two probe() calls running on different threads at once (e.g. cargo test’s default parallel test execution) can install/restore each other’s hooks out of order and corrupt the captured panic location. The bisection driver in bisect.rs only ever calls probe() sequentially on one thread anyway, so this lock is uncontended in normal use; it exists purely to make probe() itself safe to call concurrently.