public void markInUse() {
    String newName = Thread.currentThread().getName();
    do {
      String oldName = ownerThread.get();
      if (oldName != null) {
        throw new AssertionError("Tez session is already in use from "
            + oldName + "; cannot use from " + newName);
      }
    } while (!ownerThread.compareAndSet(null, newName));
  }
Mark session as being in use from TezTask, for safety/debugging purposes.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java