code: protected boolean prepareClose() {
          synchronized (lock) {
              final State state = this.state;
              if (state == State.OPEN) {
                  this.state = State.CLOSING;
                  lock.notifyAll();
                  return true;
              }
          }
          return false;
      }
docs: Signal that we are about to close the channel. This will not have any affect on the underlying channel, however
  prevent setting a new channel.
  
  @return whether the closing state was set successfully