@Override
  public void cleanup() {
    for (;;) {
      int ref = reference.get();
      if ((ref & 0x80000000) == 0) {
        return;
      }
      int nextRef = ref & 0x7fffffff;
      if (reference.compareAndSet(ref, nextRef)) {
        if (nextRef == 0) {
          if (this.reqCleanup != null) {
            this.reqCleanup.run();
          }
        }
        return;
      }
    }
  }
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