public void run() {
        try {
          stepTracker.incrementAndGet();//now 2
          //this should block until t1 unlocks
          TxnStore.MutexAPI.LockHandle handle = api.acquireLock(TxnHandler.MUTEX_KEY.HouseKeeper.name());
          stepTracker.incrementAndGet();//now 4
          Assert.assertEquals(4, stepTracker.get());
          handle.releaseLocks();
          stepTracker.incrementAndGet();//now 5
        }
        catch(Exception ex) {
          throw new RuntimeException(ex.getMessage(), ex);
        }
      }
counter = 0;
Thread1 counter=1, lock, wait 3s, check counter(should be 2), counter=3, unlock
Thread2 counter=2, lock (and block), inc counter, should be 4
ql/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandler.java