private synchronized void timeout() { if (timer != null) { timer.cancel(); timer = null; } for(OperationListener listener: new ArrayList<>(operationListeners)) { listener.timeout(); } }
synchronized void timeout() { if (timer != null) { timer.cancel(); timer = null; } for(OperationListener listener: new ArrayList<>(operationListeners)) { listener.timeout(); } }