Read/write mutexes
try_r_lock mtx tries to lock mtx for a reader without blocking.
true iff mtx could be locked, false otherwise.try_w_lock mtx tries to lock mtx for a writer without blocking.
true iff mtx could be locked, false otherwise.wrap_r_lock mtx f locks mtx for a reader, executes f and
unlocks the mutex again.
f.try_wrap_r_lock mtx f tries to lock mtx for a reader without
blocking, executes f and unlocks the mutex again.
Some
    res, where res is the result of f, iff the mutex could be locked,
None otherwise.btry_wrap_r_lock mtx f tries to lock mtx for a reader without
blocking, executes f and unlocks the mutex again.
true
iff the mutex could be locked, false otherwise.wrap_w_lock mtx f locks mtx for a writer, executes f and
unlocks the mutex again.
f.