JaroslavTulach closed pull request #448: wait longer for debugger to successfully start URL: https://github.com/apache/incubator-netbeans/pull/448
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StartActionProvider.java b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StartActionProvider.java index beaa6cd7b..0a146339c 100644 --- a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StartActionProvider.java +++ b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/StartActionProvider.java @@ -164,14 +164,21 @@ private void doStartDebugger(AbstractDICookie cookie) { debuggerImpl.setAttaching(null); VirtualMachineWrapper.setDebugTraceMode (virtualMachine, jdiTrace); - final Object startLock = new Object(); + final boolean[] startLock = { false }; Operator o = createOperator (virtualMachine, startLock); synchronized (startLock) { logger.fine("S StartActionProvider.doAction () - " + "starting operator thread"); o.start (); - if (cookie instanceof ListeningDICookie) - startLock.wait(1500); + if (cookie instanceof ListeningDICookie){ + // need to wait longer for debugger in certain cases (RoboVM) + long now = System.currentTimeMillis(); + startLock.wait(60000); + if (!startLock[0]) { + long ms = System.currentTimeMillis() - now; + logger.log(Level.WARNING, "start notification not obtained in {0} ms", ms); + } + } } debuggerImpl.setRunning ( @@ -232,7 +239,7 @@ public void removeActionsProviderListener (ActionsProviderListener l) {} private Operator createOperator ( VirtualMachine virtualMachine, - final Object startLock + final boolean [] startLock ) { return new Operator ( virtualMachine, @@ -241,6 +248,7 @@ private Operator createOperator ( @Override public boolean exec(Event event) { synchronized(startLock) { + startLock[0] = true; startLock.notify(); } return false; ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists