From 967295fba7faf66f5b76c25056fbb2b42f605665 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Tue, 21 Jun 2022 23:29:44 +1200 Subject: [PATCH] Fixes to anime-matrix system thread handling --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- daemon/Cargo.toml | 2 +- daemon/src/ctrl_anime/mod.rs | 6 ++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e721673..82311efe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased ] +## [4.1.1] - 2022-06-21 +### Changed +- Fixes to anime matrix system thread cancelation + ## [4.1.0] - 2022-06-20 ### Changed - Huge refactor to use zbus 2.2 + zvariant 3.0 in system-daemon. diff --git a/Cargo.lock b/Cargo.lock index 809812a3..d649fccc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,7 @@ dependencies = [ [[package]] name = "daemon" -version = "4.1.0" +version = "4.1.1" dependencies = [ "async-trait", "env_logger", diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index ba29ed08..1d2dfcbe 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daemon" -version = "4.1.0" +version = "4.1.1" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/daemon/src/ctrl_anime/mod.rs b/daemon/src/ctrl_anime/mod.rs index 8fc85077..0de3e459 100644 --- a/daemon/src/ctrl_anime/mod.rs +++ b/daemon/src/ctrl_anime/mod.rs @@ -169,12 +169,11 @@ impl CtrlAnime { while thread_running.load(Ordering::SeqCst) { // Make any running loop exit first thread_exit.store(true, Ordering::SeqCst); - break; } info!("AniMe no previous system thread running (now)"); thread_exit.store(false, Ordering::SeqCst); - + 'main: loop { thread_running.store(true, Ordering::SeqCst); for action in actions.iter() { @@ -216,6 +215,9 @@ impl CtrlAnime { ActionData::Matrix => {} } } + if thread_exit.load(Ordering::SeqCst) { + break 'main; + } if once || actions.is_empty() { break 'main; }