diff --git a/arduino-core/src/cc/arduino/packages/Uploader.java b/arduino-core/src/cc/arduino/packages/Uploader.java index 1d1967c36..cd9a11a45 100644 --- a/arduino-core/src/cc/arduino/packages/Uploader.java +++ b/arduino-core/src/cc/arduino/packages/Uploader.java @@ -134,7 +134,11 @@ public abstract class Uploader implements MessageConsumer { if (!process.waitFor(2, TimeUnit.MINUTES)) { process.destroyForcibly(); } - result = process.exitValue(); + if (!process.isAlive()) { + result = process.exitValue(); + } else { + result = 0; + } } catch (Exception e) { e.printStackTrace(); } diff --git a/arduino-core/src/processing/app/Platform.java b/arduino-core/src/processing/app/Platform.java index b999c8264..0c2c1d8cb 100644 --- a/arduino-core/src/processing/app/Platform.java +++ b/arduino-core/src/processing/app/Platform.java @@ -181,7 +181,7 @@ public class Platform { return list; } - public Map resolveDeviceByVendorIdProductId(String serial, Map packages) { + public synchronized Map resolveDeviceByVendorIdProductId(String serial, Map packages) { String vid_pid_iSerial = resolveDeviceAttachedToNative(serial); for (TargetPackage targetPackage : packages.values()) { for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) {