From: Keith Packard Date: Wed, 18 Dec 2013 21:09:48 +0000 (-0800) Subject: altoslib: create eeprom download thread before telling monitor about it X-Git-Tag: 1.3~13^2~7 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=b19a648b667c298d2d9d5ed4ee9db661be058d1a altoslib: create eeprom download thread before telling monitor about it Telling the monitor too early resulted in passing a null thread handle, which meant that 'cancel' wouldn't ever work. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosEepromDownload.java b/altoslib/AltosEepromDownload.java index 542defee..1b043167 100644 --- a/altoslib/AltosEepromDownload.java +++ b/altoslib/AltosEepromDownload.java @@ -239,6 +239,7 @@ public class AltosEepromDownload implements Runnable { public void start() { eeprom_thread = new Thread(this); + monitor.set_thread(eeprom_thread); eeprom_thread.start(); } @@ -255,7 +256,6 @@ public class AltosEepromDownload implements Runnable { monitor.set_states(AltosLib.ao_flight_boost, AltosLib.ao_flight_landed); - monitor.set_thread(eeprom_thread); monitor.start(); } }