From 71c41eadd12c3ece5fffce7669e4991778046d4e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 20 Nov 2010 00:09:03 -0800 Subject: [PATCH] altosui: Initialize display thread state in constructor instead of run Some state will get set before run is called, initializing it there can be too late. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosDisplayThread.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ao-tools/altosui/AltosDisplayThread.java b/ao-tools/altosui/AltosDisplayThread.java index 375965b9..3e719130 100644 --- a/ao-tools/altosui/AltosDisplayThread.java +++ b/ao-tools/altosui/AltosDisplayThread.java @@ -116,10 +116,6 @@ public class AltosDisplayThread extends Thread { } public void run () { - - reported_landing = 0; - state = null; - report_interval = 10000; try { for (;;) { set_report_time(); @@ -159,6 +155,12 @@ public class AltosDisplayThread extends Thread { } else if (spoken) set_report_time(); } + + public IdleThread() { + state = null; + reported_landing = 0; + report_interval = 10000; + } } boolean tell(AltosState state, AltosState old_state) { -- 2.30.2