Merge pull request #3903 from ethcore/test-mem-limit-deadlock

fix deadlock in queue drop
This commit is contained in:
Gav Wood 2016-12-19 22:23:56 +01:00 committed by GitHub
commit 18965be047

View File

@ -687,8 +687,12 @@ impl<K: Kind> Drop for VerificationQueue<K> {
*self.state.0.lock() = State::Exit;
self.state.1.notify_all();
// wake up all threads waiting for more work.
self.more_to_verify.notify_all();
// acquire this lock to force threads to reach the waiting point
// if they're in-between the exit check and the more_to_verify wait.
{
let _more = self.verification.more_to_verify.lock().unwrap();
self.more_to_verify.notify_all();
}
// wait for all verifier threads to join.
for thread in self.verifier_handles.drain(..) {