Ejemplo n.º 1
0
 public void start() {
   synchronized (monitor) {
     active = true;
     waiters.add(Thread.currentThread());
     monitor.notify();
   }
 }
Ejemplo n.º 2
0
 public void stop() {
   synchronized (monitor) {
     active = false;
     waiters.remove(Thread.currentThread());
     monitor.notify();
   }
 }
Ejemplo n.º 3
0
 /**
  * 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;
   }
 }