Workarounding thread hostile debugger.jpda.
1.1 --- a/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ActiveSessions.java Thu Jan 30 19:12:26 2014 +0100
1.2 +++ b/dew4nb/src/org/netbeans/modules/dew4nb/services/debugger/ActiveSessions.java Fri Jan 31 09:46:45 2014 +0100
1.3 @@ -117,10 +117,18 @@
1.4 }
1.5 try {
1.6 jpda.waitRunning();
1.7 - } catch (DebuggerStartException ex) {
1.8 + //Hack:
1.9 + //Now comes the fun, JPDADebuggerImpl is full of races
1.10 + //so after wait we need to busy wait. Inverted spin-park :-)
1.11 + while (jpda.getState() < 2) {
1.12 + Thread.sleep(500);
1.13 + }
1.14 + } catch (DebuggerStartException | InterruptedException ex) {
1.15 return -1;
1.16 }
1.17 - return id;
1.18 + return jpda.getState() == JPDADebugger.STATE_RUNNING ?
1.19 + id :
1.20 + -1;
1.21 }
1.22 return -1;
1.23 }