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

@@ -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;
}