mirror of
https://github.com/processing/processing4.git
synced 2026-02-15 11:25:38 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user