code: public ISynchronizationPoint<OutputErrorType> flush() {
  		SynchronizationPoint<OutputErrorType> sp = new SynchronizationPoint<>();
  		Runnable callback = new Runnable() {
  			@Override
  			public void run() {
  				AsyncWork<OutputResultType, OutputErrorType> last = null;
  				synchronized (waiting) {
  					if (error != null) sp.error(error);
  					else if (cancelled != null) sp.cancel(cancelled);
  					else if (isReady) sp.unblock();
  					else last = lastWrite;
  				}
  				if (last != null)
  					last.listenInline(this);
  			}
  		};
  		callback.run();
  		return sp;
  	}
docs: Same as getLastPendingOperation but never return null (return an unblocked synchronization point instead).