[][src]Function padlock::rw_read_lock

pub fn rw_read_lock<T, F, R>(l: &RwLock<T>, f: F) -> R where
    F: FnOnce(&T) -> R, 

Aquire a RwLock read lock, passing the lock to the lambda. The lock is released when the lambda finishes. This function returns whatever the lambda returns, allowing you to extract data from a lock without having to worry about releasing the lock.

This example is not tested
let extracted = padlock::rw_read_lock(&arc_rwlock_var, |lock| lock.clone());