reorganized files

This commit is contained in:
2025-12-05 12:50:25 +08:00
parent d9dbd5fe5d
commit a9068fe575
13 changed files with 18 additions and 22 deletions

View File

@@ -0,0 +1,29 @@
#[macro_export]
macro_rules! lock_r {
($rwlock:expr) => {{
match $rwlock.read() {
Ok(guard) => guard,
Err(_) => panic!(
"Failed to acquire read lock on {} at {}:{}",
stringify!($rwlock),
file!(),
line!()
),
}
}};
}
#[macro_export]
macro_rules! lock_w {
($rwlock:expr) => {{
match $rwlock.write() {
Ok(guard) => guard,
Err(_) => panic!(
"Failed to acquire write lock on {} at {}:{}",
stringify!($rwlock),
file!(),
line!()
),
}
}};
}