MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / lock_bus

Function lock_bus

nodedb/src/control/shutdown/bus.rs:182–190  ·  view source on GitHub ↗
(state: &Mutex<BusState>)

Source from the content-addressed store, hash-verified

180}
181
182fn lock_bus(state: &Mutex<BusState>) -> std::sync::MutexGuard<'_, BusState> {
183 match state.lock() {
184 Ok(g) => g,
185 Err(p) => {
186 error!(target: "shutdown", "ShutdownBus mutex poisoned — recovering");
187 p.into_inner()
188 }
189 }
190}
191
192impl ShutdownBus {
193 /// Create a new `ShutdownBus`. Returns the bus (for registering tasks

Callers 4

report_drainedMethod · 0.85
register_taskMethod · 0.85
initiateMethod · 0.85
set_metricsMethod · 0.85

Calls 1

lockMethod · 0.80

Tested by

no test coverage detected