Another 'fix': added a timeout before vm.resume()

I think we have a race condition: vm.resume() is called *before* the VM is
actually ready to resume.  That is strange, since the debugger is
attached, eventQueues are set up and ready...  Still, waiting for a bit
ensures that the VM actually resumes.  This behavior was not present when
Java 1.6 was still used.  Is this a bug in Java 1.7? Or is it simply that
the VM in 1.6 started up quickly enough to hide the race condition?

I'll continue looking...
This commit is contained in:
David Fokkema
2014-04-19 10:09:10 +02:00
parent fd40dbfb31
commit c46c34c033

View File

@@ -710,6 +710,12 @@ 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