b91da2242d
The Blockstore currently maintains a RwLock<Slot> of the maximum root it has seen inserted. The value is initialized during Blockstore::open() and updated during calls to Blockstore::set_roots(). The max root is queried fairly often for several use cases, and caching the value is cheaper than constructing an iterator to look it up every time. However, the access patterns of these RwLock match that of an atomic. That is, there is no critical section of code that is run while the lock is head. Rather, read/write locks are acquired in order to read/ update, respectively. So, change the RwLock<u64> to an AtomicU64. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
.gitignore | ||
Cargo.toml | ||
build.rs |