Fix a race condition
This commit is contained in:
parent
ecd5efa641
commit
4fac7396a2
1 changed files with 5 additions and 2 deletions
|
@ -103,8 +103,11 @@ impl<'tcx> QueryJob<'tcx> {
|
||||||
condvar: Condvar::new(),
|
condvar: Condvar::new(),
|
||||||
});
|
});
|
||||||
self.latch.await(&waiter);
|
self.latch.await(&waiter);
|
||||||
|
// FIXME: Get rid of this lock. We have ownership of the QueryWaiter
|
||||||
match Lrc::get_mut(&mut waiter).unwrap().cycle.get_mut().take() {
|
// although another thread may still have a Lrc reference so we cannot
|
||||||
|
// use Lrc::get_mut
|
||||||
|
let mut cycle = waiter.cycle.lock();
|
||||||
|
match cycle.take() {
|
||||||
None => Ok(()),
|
None => Ok(()),
|
||||||
Some(cycle) => Err(cycle)
|
Some(cycle) => Err(cycle)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue