private void replAbortTxnForTest(List<Long> txnList, String replPolicy)
          throws Exception {
    for (Long txnId : txnList) {
      AbortTxnRequest rqst = new AbortTxnRequest(txnId);
      rqst.setReplPolicy(replPolicy);
      rqst.setTxn_type(TxnType.REPL_CREATED);
      txnHandler.abortTxn(rqst);
    }
    checkReplTxnForTest(txnList.get(0), txnList.get(txnList.size() - 1), replPolicy, new ArrayList<>());
  }
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