public void releaseByWAL() {
    // Here this method of decrementAndGet for releasing WAL reference count will work in both
    // cases - i.e. highest bit (cleanup) 1 or 0. We will be decrementing a negative or positive
    // value respectively in these 2 cases, but the logic will work the same way
    if (reference.decrementAndGet() == 0) {
      if (this.reqCleanup != null) {
        this.reqCleanup.run();
      }
    }

  }
Call is done. Execution happened and we returned results to client. It is now safe to cleanup.
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/ServerCall.java