That problem with borrowing is unfixable unless you change try_lock to return the &mut in case of failure.

Right now, in case of failure, the mutex is inaccessible for the lifetime 'a, which makes using try_lock in the implementation of lock impossible.

I think we should return Result<Guard<'a>, &'a mut Mutex> from try_lock to fix this.