batch-lock
A lock manager with batch-lock support.
Usage
To use this library, add the following to your Cargo.toml:
[]
= "0.1"
Then, you can import and use the components as follows:
use LockManager;
let lock_manager = new;
let lock_guard = lock_manager.lock;
// key = 1 is locked.
drop;
use BTreeSet;
let batch_keys = .into_iter.;
let batch_lock_guard = lock_manager.batch_lock;
// 2, 3, 5, 7 are locked in batch.
drop;