mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 13:33:31 +00:00
Fix deadlock
This commit is contained in:
parent
567bde603c
commit
2ece0fbfef
1 changed files with 6 additions and 0 deletions
|
@ -131,6 +131,7 @@ impl NotifyActor {
|
||||||
let (entry_tx, entry_rx) = unbounded();
|
let (entry_tx, entry_rx) = unbounded();
|
||||||
let (watch_tx, watch_rx) = unbounded();
|
let (watch_tx, watch_rx) = unbounded();
|
||||||
let processed = AtomicUsize::new(0);
|
let processed = AtomicUsize::new(0);
|
||||||
|
|
||||||
config.load.into_par_iter().enumerate().for_each(|(i, entry)| {
|
config.load.into_par_iter().enumerate().for_each(|(i, entry)| {
|
||||||
let do_watch = config.watch.contains(&i);
|
let do_watch = config.watch.contains(&i);
|
||||||
if do_watch {
|
if do_watch {
|
||||||
|
@ -167,9 +168,13 @@ impl NotifyActor {
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
drop(watch_tx);
|
||||||
for path in watch_rx {
|
for path in watch_rx {
|
||||||
self.watch(&path);
|
self.watch(&path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drop(entry_tx);
|
||||||
for entry in entry_rx {
|
for entry in entry_rx {
|
||||||
match entry {
|
match entry {
|
||||||
loader::Entry::Files(files) => {
|
loader::Entry::Files(files) => {
|
||||||
|
@ -180,6 +185,7 @@ impl NotifyActor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.sender
|
self.sender
|
||||||
.send(loader::Message::Progress {
|
.send(loader::Message::Progress {
|
||||||
n_total,
|
n_total,
|
||||||
|
|
Loading…
Reference in a new issue