@Override public void run() { FireringAction action; while (!stopped) { try { synchronized (toFireMutex) { while (toFire.isEmpty() && !stopped) { toFireMutex.wait(); } if (stopped) { break; } action = toFire.poll(); } startWatchdog(action.startTime); fireTo.fireAction(action.action); stopWatchdog(); } catch (Throwable e) { System.err.println("Exception while handling action:"); e.printStackTrace(); if (blockingListener != null) { blockingListener.actionThreadCaughtException(e); } } if (toFire.isEmpty()) { disableWatchdog(); } } } }