macro_rules! read_lock {
($lock:expr) => { ... };
}Expand description
Helper macro for acquiring a read lock.
On native targets, this awaits the async lock. On WASM, this uses the blocking (but single-threaded safe) lock.
§Lock Poisoning (WASM only)
On WASM targets, lock poisoning is recovered by taking the inner guard. This avoids panic-only behavior in adapter/runtime helpers.
§Example
ⓘ
let guard = read_lock!(self.data);
println!("{:?}", *guard);