private void notifyNextAction() { trace("Notify next action " + this + ": " + Thread.currentThread()); executing.release(); }
private void notifyNextAction() { trace("Notify next action " + this + ": " + Thread.currentThread()); executing.release(); }
private void putEvent(Object event) { trace("Put event " + this + ": " + Thread.currentThread()); if (event instanceof SuspendedEvent) { try { handler.onSuspend((SuspendedEvent) event); } catch (Throwable e) { newEvent.add(e); return; } } newEvent.add(event); }
private void putEvent(Object event) { trace("Put event " + this + ": " + Thread.currentThread()); if (event instanceof SuspendedEvent) { try { if (handler == null) { throw new AssertionError("Expected done but got event " + event); } handler.onSuspend((SuspendedEvent) event); } catch (Throwable e) { newEvent.add(e); return; } } newEvent.add(event); }
/** * Closes the current debugger tester session and all its associated resources like the * background thread. The debugger tester becomes unusable after closing. * * @since 0.16 */ public void close() { if (closed) { throw new IllegalStateException("Already closed."); } closed = true; trace("kill session " + this); // trying to interrupt if execution is in IO. notifyNextAction(); try { evalThread.join(); } catch (InterruptedException iex) { throw new AssertionError("Interrupted while joining eval thread.", iex); } engine.close(); }
/** * Closes the current debugger tester session and all its associated resources like the * background thread. The debugger tester becomes unusable after closing. * * @since 0.16 */ public void close() { if (closed) { throw new IllegalStateException("Already closed."); } closed = true; trace("kill session " + this); // trying to interrupt if execution is in IO. notifyNextAction(); try { evalThread.join(); } catch (InterruptedException iex) { throw new AssertionError("Interrupted while joining eval thread.", iex); } engine.close(); }