1 2 3 4 5 6
use std::sync::{Mutex, OnceLock}; pub(crate) fn device_allocation_lock() -> &'static Mutex<()> { static LOCK: OnceLock<Mutex<()>> = OnceLock::new(); LOCK.get_or_init(|| Mutex::new(())) }