Wait for VMStartEvent before resuming VM

Fixes processing#2402

(Oh, yes!)
This commit is contained in:
David Fokkema
2014-04-19 10:36:00 +02:00
parent c46c34c033
commit e3090697e4

View File

@@ -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?