ec886ddefb
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.
11 lines
257 B
TOML
11 lines
257 B
TOML
[package]
|
|
description = "Mutex with cached len, for use with collections"
|
|
homepage = "http://parity.io"
|
|
license = "GPL-3.0"
|
|
name = "len-caching-mutex"
|
|
version = "0.1.0"
|
|
authors = ["Parity Technologies <admin@parity.io>"]
|
|
|
|
[dependencies]
|
|
parking_lot = "0.6"
|