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