Revert "No nursery for render thread"

This reverts commit 59da2337bd8076b147e4eb76f7ad82d17ac0c8c2.
This commit is contained in:
Jeremy Wall 2020-07-31 14:40:37 -04:00
parent 59da2337bd
commit e9d4a770d3

View File

@ -216,6 +216,8 @@ fn main() -> anyhow::Result<()> {
});
parent.schedule(Box::new(connect_thread));
}
let stop_signal = stop_signal.clone();
let render_thread = thread::Pending::new(move || {
debug!("attempting to start server on {}", LISTENHOST.flag);
let server = match tiny_http::Server::http(LISTENHOST.flag) {
Ok(server) => server,
@ -224,7 +226,7 @@ fn main() -> anyhow::Result<()> {
*signal = true;
error!("Error starting render thread {}", err);
error!("Shutting down all threads...");
return Err(anyhow::Error::msg(format!("{}", err)));
return;
}
};
loop {
@ -247,4 +249,9 @@ fn main() -> anyhow::Result<()> {
}
}
}
});
parent.schedule(Box::new(render_thread));
// Blocks forever
parent.wait();
Ok(())
}