about summary refs log tree commit diff
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-08-11 14:58:50 +0200
committermo8it <mo8it@proton.me>2024-08-11 14:58:50 +0200
commit97a6fc65f17febf77b88f08a19b9b461fb7126bc (patch)
treecb3a8f432e7ab6de57d9a8f5436bf278d83db952
parent7341b88e6f1fd39e4650aa26530ac53b1888d9ca (diff)
downloadrust-97a6fc65f17febf77b88f08a19b9b461fb7126bc.tar.gz
rust-97a6fc65f17febf77b88f08a19b9b461fb7126bc.zip
Fix deadlock
-rw-r--r--src/tools/rust-analyzer/crates/vfs-notify/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/vfs-notify/src/lib.rs b/src/tools/rust-analyzer/crates/vfs-notify/src/lib.rs
index 2bd4eb67135..bf96788d373 100644
--- a/src/tools/rust-analyzer/crates/vfs-notify/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/vfs-notify/src/lib.rs
@@ -131,6 +131,7 @@ impl NotifyActor {
                         let (entry_tx, entry_rx) = unbounded();
                         let (watch_tx, watch_rx) = unbounded();
                         let processed = AtomicUsize::new(0);
+
                         config.load.into_par_iter().enumerate().for_each(|(i, entry)| {
                             let do_watch = config.watch.contains(&i);
                             if do_watch {
@@ -167,9 +168,13 @@ impl NotifyActor {
                                 })
                                 .unwrap();
                         });
+
+                        drop(watch_tx);
                         for path in watch_rx {
                             self.watch(&path);
                         }
+
+                        drop(entry_tx);
                         for entry in entry_rx {
                             match entry {
                                 loader::Entry::Files(files) => {
@@ -180,6 +185,7 @@ impl NotifyActor {
                                 }
                             }
                         }
+
                         self.sender
                             .send(loader::Message::Progress {
                                 n_total,