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
+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>