Use LenCachingMutex to optimize verification. (#10117)

This commit is contained in:
Tomasz Drwięga 2019-01-03 14:11:07 +01:00 committed by Niklas Adolfsson
parent 469f9c26e7
commit 801b8191ef

View File

@ -585,10 +585,12 @@ impl<K: Kind> VerificationQueue<K> {
}
/// Returns true if there is nothing currently in the queue.
/// TODO [ToDr] Optimize to avoid locking
pub fn is_empty(&self) -> bool {
let v = &self.verification;
v.unverified.lock().is_empty() && v.verifying.lock().is_empty() && v.verified.lock().is_empty()
v.unverified.load_len() == 0
&& v.verifying.load_len() == 0
&& v.verified.load_len() == 0
}
/// Get queue status.