fix deadlock in queue drop

This commit is contained in:
Robert Habermeier 2016-12-19 17:15:54 +01:00
parent 14a9942d14
commit ae8f77bc7c

View File

@ -681,8 +681,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.
// 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(..) {