Open Aandreba opened 1 year ago
Are you looking for something like ArcMutexGuard
? You might want to use the parking_lot implementations instead.
I know of parking_lot
, but their implementation of the locks is completely different, and alos their owned locks are restricted to Arc
s. In the case I want to get the lock from an Rc
, Ref
(a RefCell
guard) or any other dereferencing type, I'll be forced to get it by reference.
Currently, the locks guards are defined like this:
But there are a lot of instances where taking a reference to the lock is not as versatile as it could be, so perhaps a redefinition of the locks to something like this makes more sense.