synchronized void writeAll() {
        Queue<DelayedWritesCloses> writers = waitingWriters;

        if(writers.isEmpty())
            return;

        while(!writers.isEmpty()) {
            DelayedWritesCloses writer = writers.peek();
            boolean finished = writer.runDelayedAction(true);
            if(!finished) {
                if(log.isLoggable(Level.FINER))
                    log.finer(this+"Did not write all of id="+writer);
                break;
            }
            //if it finished, remove the item from the queue.  It
            //does not need to be run again.
            writers.remove();
        }
        
        if(writers.isEmpty()) {
            if(log.isLoggable(Level.FINER))
                log.fine(this+"unregister writes");
            registered = false;
            Helper.unregisterSelectableChannel(this, SelectionKey.OP_WRITE); 
        }
    }