A simple locking library that allows you to easily and safely access the interior of Arc
Adds the following methods to each Arc
``` mutex.with_lock(|data| { // do stuff });
// this is the same but uses trylock instead of lock().unwrap() mutex.withlock_try(|data| { // do stuff }); ``` The closure can also return any type
You can also clone the inner value simply by doing:
``` let innervalueclone = mutex.get_clone(); // if you're sure you can lock the mutex
let innervaluecloneoptional = mutex.trygetclone(); // if you want an option that's none when the mutex can't be locked (uses trylock internally) ``` But the inner value of course needs to implement Clone
does not introduce new types and works on all existing Arc