arbitrary-lock
Acquire a lock on an arbitrary key, like a string or integer.
Usage
Add the dependency to your project:
Use the struct:
// This can be cheaply cloned.
// The key must be Hash + Eq + Clone.
// Provide your preferred lock type as the second generic argument. It must implement Default.
let locker = new;
;