summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-11 21:48:00 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-11 21:48:00 -0500
commit35a7db590aab2c8d1508115a490678fce6376000 (patch)
tree7c446e93616b938e397879700d4228600c496da9
parentcf49952cb1d0c5a4b233bb54a29a0c580f73360d (diff)
downloadnbsh-35a7db590aab2c8d1508115a490678fce6376000.tar.gz
nbsh-35a7db590aab2c8d1508115a490678fce6376000.zip
move the std channel adaptor thread onto the thread pool
instead of managing a separate thread manually
-rw-r--r--src/shell/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shell/mod.rs b/src/shell/mod.rs
index f909dca..e7160be 100644
--- a/src/shell/mod.rs
+++ b/src/shell/mod.rs
@@ -104,7 +104,7 @@ pub async fn main() -> anyhow::Result<i32> {
watcher
.watch(&dir, notify::RecursiveMode::Recursive)
.unwrap();
- std::thread::spawn(move || {
+ async_std::task::spawn(blocking::unblock(move || {
while let Ok(event) = sync_watch_r.recv() {
let watch_w = watch_w.clone();
let send_failed =
@@ -115,7 +115,7 @@ pub async fn main() -> anyhow::Result<i32> {
break;
}
}
- });
+ }));
let event_w = event_w.clone();
async_std::task::spawn(async move {
while watch_r.recv().await.is_ok() {