Fixes to anime-matrix system thread handling

This commit is contained in:
Luke D. Jones
2022-06-21 23:29:44 +12:00
parent 5403c5fb4f
commit 967295fba7
4 changed files with 10 additions and 4 deletions

View File

@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased ] ## [Unreleased ]
## [4.1.1] - 2022-06-21
### Changed
- Fixes to anime matrix system thread cancelation
## [4.1.0] - 2022-06-20 ## [4.1.0] - 2022-06-20
### Changed ### Changed
- Huge refactor to use zbus 2.2 + zvariant 3.0 in system-daemon. - Huge refactor to use zbus 2.2 + zvariant 3.0 in system-daemon.

2
Cargo.lock generated
View File

@@ -278,7 +278,7 @@ dependencies = [
[[package]] [[package]]
name = "daemon" name = "daemon"
version = "4.1.0" version = "4.1.1"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"env_logger", "env_logger",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "daemon" name = "daemon"
version = "4.1.0" version = "4.1.1"
license = "MPL-2.0" license = "MPL-2.0"
readme = "README.md" readme = "README.md"
authors = ["Luke <luke@ljones.dev>"] authors = ["Luke <luke@ljones.dev>"]

View File

@@ -169,12 +169,11 @@ impl CtrlAnime {
while thread_running.load(Ordering::SeqCst) { while thread_running.load(Ordering::SeqCst) {
// Make any running loop exit first // Make any running loop exit first
thread_exit.store(true, Ordering::SeqCst); thread_exit.store(true, Ordering::SeqCst);
break;
} }
info!("AniMe no previous system thread running (now)"); info!("AniMe no previous system thread running (now)");
thread_exit.store(false, Ordering::SeqCst); thread_exit.store(false, Ordering::SeqCst);
'main: loop { 'main: loop {
thread_running.store(true, Ordering::SeqCst); thread_running.store(true, Ordering::SeqCst);
for action in actions.iter() { for action in actions.iter() {
@@ -216,6 +215,9 @@ impl CtrlAnime {
ActionData::Matrix => {} ActionData::Matrix => {}
} }
} }
if thread_exit.load(Ordering::SeqCst) {
break 'main;
}
if once || actions.is_empty() { if once || actions.is_empty() {
break 'main; break 'main;
} }