Advance Red Bear runtime services and tools

This commit is contained in:
2026-04-20 18:37:35 +01:00
parent 2b3b592dab
commit f3e6b09811
24 changed files with 1362 additions and 357 deletions
@@ -1,5 +1,7 @@
use zbus::Connection;
use crate::runtime_state::SharedRuntime;
#[cfg(target_os = "redox")]
const KSTOP_PATH: &str = "/scheme/kernel.acpi/kstop";
@@ -13,10 +15,13 @@ fn wait_for_shutdown_edge() -> std::io::Result<()> {
Ok(())
}
pub async fn watch_and_emit(connection: Connection) {
pub async fn watch_and_emit(connection: Connection, runtime: SharedRuntime) {
#[cfg(target_os = "redox")]
match tokio::task::spawn_blocking(wait_for_shutdown_edge).await {
Ok(Ok(())) => {
if let Ok(mut state) = runtime.write() {
state.preparing_for_shutdown = true;
}
let _ = connection
.emit_signal(
None::<&str>,
@@ -38,5 +43,6 @@ pub async fn watch_and_emit(connection: Connection) {
#[cfg(not(target_os = "redox"))]
{
let _ = connection;
let _ = runtime;
}
}