From b11e25ecf2618b65309cdb2fa31459d90555038d Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Tue, 12 May 2009 13:37:51 +0000 Subject: [PATCH] Fixing (I hope) race condition in Sizer.java that was preventing the file size from being determined. --- app/Sizer.java | 15 +++++++++++---- readme.txt | 11 +++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/Sizer.java b/app/Sizer.java index de1bd5d6b..818237424 100644 --- a/app/Sizer.java +++ b/app/Sizer.java @@ -57,17 +57,24 @@ public class Sizer implements MessageConsumer { commandSize[1] = buildPath + File.separator + sketchName + ".hex"; + int r = 0; try { exception = null; size = -1; firstLine = null; Process process = Runtime.getRuntime().exec(commandSize); - new MessageSiphon(process.getInputStream(), this); - new MessageSiphon(process.getErrorStream(), this); + MessageSiphon in = new MessageSiphon(process.getInputStream(), this); + MessageSiphon err = new MessageSiphon(process.getErrorStream(), this); + boolean running = true; + while(running) { try { - process.waitFor(); + if (in.thread != null) + in.thread.join(); + if (err.thread != null) + err.thread.join(); + r = process.waitFor(); running = false; } catch (InterruptedException intExc) { } } @@ -76,7 +83,7 @@ public class Sizer implements MessageConsumer { // some sub-class has overridden it to do so, thus we need to check for // it. See: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1166589459 exception = new RunnerException( - (e.toString() == null) ? e.getClass().getName() : e.toString()); + (e.toString() == null) ? e.getClass().getName() + r : e.toString() + r); } if (exception != null) diff --git a/readme.txt b/readme.txt index 120e7e6d8..891198f53 100644 --- a/readme.txt +++ b/readme.txt @@ -48,13 +48,24 @@ UPDATES 0016 +[documentation / examples] +* New communication examples (w/ corresponding Processing and Max/MSP code) by + Tom Igoe. + [core / libraries] +* Adding support for the Arduino Pro and Pro Mini 3.3V / 8 MHz w/ ATmega328. * Adding write(str) and write(buf, size) methods to Print, Serial, and the Ethernet library Client and Server classes. This allows for more efficient (fewer packet) Ethernet communication. (Thanks to mikalhart.) * Improvements to the way the Ethernet library Client class connects and disconnects. Should reduce or eliminate failed connections and long timeouts. (Thanks to Bruce Luckcuck.) +* Optimizing the timer0 overflow interrupt handler (used for millis() and + micros()). Thanks to westfw and mikalhart. + +[environment] +* Eliminating (maybe) the occasional "Couldn't determine program size" errors. + Thanks to the Clever Monkey. 0015 - 2009.03.26