fix deadlock in queue drop
This commit is contained in:
parent
14a9942d14
commit
ae8f77bc7c
@ -681,8 +681,12 @@ impl<K: Kind> Drop for VerificationQueue<K> {
|
|||||||
*self.state.0.lock() = State::Exit;
|
*self.state.0.lock() = State::Exit;
|
||||||
self.state.1.notify_all();
|
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();
|
self.more_to_verify.notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
// wait for all verifier threads to join.
|
// wait for all verifier threads to join.
|
||||||
for thread in self.verifier_handles.drain(..) {
|
for thread in self.verifier_handles.drain(..) {
|
||||||
|
Loading…
Reference in New Issue
Block a user