@Override
    public void unlock() {
      SessionState.get().getCompileLock().unlock();
      globalCompileQuotas.release();
    }
Combination of global semaphore and session reentrant lock.
ql/src/java/org/apache/hadoop/hive/ql/lock/CompileLockFactory.java