public void waitForFinish(boolean waitForWakeup) throws InterruptedException, ClosedChannelException {

		synchronized(this) {

			if(!processed) {
				if(log.isLoggable(Level.FINE))
					log.fine(id+"call wakeup on selector to register for="+r);
				s.wakeUpSelector();
				//selector.wakeup();
				if(waitForWakeup)
					this.wait();
			}
		}
		if(exc != null) {
            exc.fillInStackTrace();
			throw exc;
        } else if(runtime != null) {
            runtime.fillInStackTrace();
			throw runtime;		
        }
	}