Merge branch 'master' into temp-path
Conflicts: util/Cargo.toml util/src/lib.rs
This commit is contained in:
@@ -153,7 +153,7 @@ impl BlockQueue {
|
||||
}
|
||||
|
||||
fn verify(verification: Arc<Mutex<Verification>>, engine: Arc<Box<Engine>>, wait: Arc<Condvar>, ready: Arc<QueueSignal>, deleting: Arc<AtomicBool>, empty: Arc<Condvar>) {
|
||||
while !deleting.load(AtomicOrdering::Relaxed) {
|
||||
while !deleting.load(AtomicOrdering::Acquire) {
|
||||
{
|
||||
let mut lock = verification.lock().unwrap();
|
||||
|
||||
@@ -161,11 +161,11 @@ impl BlockQueue {
|
||||
empty.notify_all();
|
||||
}
|
||||
|
||||
while lock.unverified.is_empty() && !deleting.load(AtomicOrdering::Relaxed) {
|
||||
while lock.unverified.is_empty() && !deleting.load(AtomicOrdering::Acquire) {
|
||||
lock = wait.wait(lock).unwrap();
|
||||
}
|
||||
|
||||
if deleting.load(AtomicOrdering::Relaxed) {
|
||||
if deleting.load(AtomicOrdering::Acquire) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -347,7 +347,7 @@ impl MayPanic for BlockQueue {
|
||||
impl Drop for BlockQueue {
|
||||
fn drop(&mut self) {
|
||||
self.clear();
|
||||
self.deleting.store(true, AtomicOrdering::Relaxed);
|
||||
self.deleting.store(true, AtomicOrdering::Release);
|
||||
self.more_to_verify.notify_all();
|
||||
for t in self.verifiers.drain(..) {
|
||||
t.join().unwrap();
|
||||
|
||||
@@ -419,11 +419,11 @@ impl BlockChainClient for Client {
|
||||
}
|
||||
|
||||
fn state_data(&self, _hash: &H256) -> Option<Bytes> {
|
||||
unimplemented!();
|
||||
None
|
||||
}
|
||||
|
||||
fn block_receipts(&self, _hash: &H256) -> Option<Bytes> {
|
||||
unimplemented!();
|
||||
None
|
||||
}
|
||||
|
||||
fn import_block(&self, bytes: Bytes) -> ImportResult {
|
||||
|
||||
@@ -124,20 +124,18 @@ impl IoHandler<NetSyncMessage> for ClientIoHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: rewrite into something that doesn't dependent on the testing environment having a particular port ready for use.
|
||||
/*
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use tests::helpers::*;
|
||||
use util::network::*;
|
||||
use devtools::*;
|
||||
|
||||
#[test]
|
||||
fn it_can_be_started() {
|
||||
let spec = get_test_spec();
|
||||
let temp_path = RandomTempPath::new();
|
||||
let service = ClientService::start(spec, NetworkConfiguration::new(), &temp_path.as_path());
|
||||
let service = ClientService::start(spec, NetworkConfiguration::new_with_port(40456), &temp_path.as_path());
|
||||
assert!(service.is_ok());
|
||||
}
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user