MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / with_lock

Method with_lock

crates/openshell-core/src/proposals.rs:65–75  ·  view source on GitHub ↗
(enabled: bool, lock: MutexGuard<'static, ()>)

Source from the content-addressed store, hash-verified

63 }
64
65 fn with_lock(enabled: bool, lock: MutexGuard<'static, ()>) -> Self {
66 let flag = super::AGENT_PROPOSALS_ENABLED
67 .get_or_init(|| Arc::new(AtomicBool::new(false)))
68 .clone();
69 let prev = flag.swap(enabled, Ordering::Relaxed);
70 Self {
71 prev,
72 flag,
73 _lock: lock,
74 }
75 }
76 }
77
78 impl Drop for ProposalsFlagGuard {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected