LenCachingMutex (#9988)
New util LenCachingMutex can be used in place of a Mutex, when working
with collections, or other types with a len() method. When
the Guard is dropped, the value returned from len() is stored
into an AtomicUsize and can be queried using load_len() without
needing to lock the Mutex. Implementations for ```Vec``` and
```VecDeque```.
Now used in [Verification](4ded4181a6/ethcore/src/verification/queue/mod.rs (L196)) so that calls to ```VerificationQueue.queue_info()```
no longer require locks.
This commit is contained in:
@@ -112,6 +112,7 @@ extern crate journaldb;
|
||||
extern crate serde;
|
||||
#[cfg(any(test, feature = "json-tests", feature = "test-helpers"))]
|
||||
extern crate tempdir;
|
||||
extern crate len_caching_mutex;
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows", target_os = "android"))]
|
||||
extern crate hardware_wallet;
|
||||
|
||||
Reference in New Issue
Block a user