diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-20 00:09:03 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-11-20 00:09:03 -0800 |
commit | 71c41eadd12c3ece5fffce7669e4991778046d4e (patch) | |
tree | 70967e937aef3cca3d07d8a6b488bd4e94879394 | |
parent | 7920ed5c34b088f45ce4213b061ddd1ffe22cee8 (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | ao-tools/altosui/AltosDisplayThread.java | 10 |
1 files 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) { |