mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 02:20:45 +01:00
Wait for VMStartEvent before resuming VM
Fixes processing#2402 (Oh, yes!)
This commit is contained in:
@@ -678,7 +678,9 @@ public class Runner implements MessageConsumer {
|
||||
|
||||
for (Event event : eventSet) {
|
||||
// System.out.println("EventThread.handleEvent -> " + event);
|
||||
if (event instanceof ExceptionEvent) {
|
||||
if (event instanceof VMStartEvent) {
|
||||
vm.resume();
|
||||
} else if (event instanceof ExceptionEvent) {
|
||||
// for (ThreadReference thread : vm.allThreads()) {
|
||||
// System.out.println("thread : " + thread);
|
||||
//// thread.suspend();
|
||||
@@ -710,14 +712,6 @@ public class Runner implements MessageConsumer {
|
||||
errThread.start();
|
||||
outThread.start();
|
||||
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch(InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
vm.resume();
|
||||
|
||||
// Shutdown begins when event thread terminates
|
||||
try {
|
||||
if (eventThread != null) eventThread.join(); // is this the problem?
|
||||
|
||||
Reference in New Issue
Block a user