Move import lock onto backend (#2797)

* Drop import_lock from client, move it into backend, impl default version via static mutex

* still need to allow depcretion because of client.backend

* additional docs

* Remove default impl of get_import_lock, impl on instances

* Bump parking_lot to 0.8.0 accross the board
This commit is contained in:
Benjamin Kampmann
2019-06-05 15:46:01 +02:00
committed by Bastian Köcher
parent 4f888f34d3
commit eaa0ab014a
37 changed files with 101 additions and 97 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
parking_lot = "0.7.1"
parking_lot = "0.8"
log = "0.4"
kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
# FIXME replace with release as soon as our rocksdb changes are released upstream https://github.com/paritytech/parity-common/issues/88
+6
View File
@@ -656,6 +656,7 @@ pub struct Backend<Block: BlockT> {
blockchain: BlockchainDb<Block>,
canonicalization_delay: u64,
shared_cache: SharedCache<Block, Blake2Hasher>,
import_lock: Mutex<()>,
}
impl<Block: BlockT<Hash=H256>> Backend<Block> {
@@ -722,6 +723,7 @@ impl<Block: BlockT<Hash=H256>> Backend<Block> {
blockchain,
canonicalization_delay,
shared_cache: new_shared_cache(state_cache_size),
import_lock: Default::default(),
})
}
@@ -1350,6 +1352,10 @@ impl<Block> client::backend::Backend<Block, Blake2Hasher> for Backend<Block> whe
}
Ok(())
}
fn get_import_lock(&self) -> &Mutex<()> {
&self.import_lock
}
}
impl<Block> client::backend::LocalBackend<Block, Blake2Hasher> for Backend<Block>