()
| 17 | std::sync::OnceLock::new(); |
| 18 | |
| 19 | fn get_file_locks() -> Arc<std::sync::Mutex<HashMap<String, Arc<Mutex<()>>>>> { |
| 20 | FILE_LOCKS |
| 21 | .get_or_init(|| Arc::new(std::sync::Mutex::new(HashMap::new()))) |
| 22 | .clone() |
| 23 | } |
| 24 | |
| 25 | pub async fn with_file_lock<F, Fut, T>(filepath: &str, f: F) -> T |
| 26 | where |
no test coverage detected