public void start() { synchronized (monitor) { active = true; waiters.add(Thread.currentThread()); monitor.notify(); } }
public void stop() { synchronized (monitor) { active = false; waiters.remove(Thread.currentThread()); monitor.notify(); } }
/** * Sets timeout for streams given by this connection * * @param timeout * @throws IOException */ public void setTimeout(long timeout) throws IOException { doSetTimeout(timeout); if (watchdog != null) { synchronized (watchdogMonitor) { this.timeout = timeout; watchdogMonitor.notify(); } } else { this.timeout = timeout; } }