code: private void unlockCompletely(ReentrantLock lockToUnlock){
          int counter = lockToUnlock.getHoldCount();
  
          for(int i = 0; i<counter; i++){
              lockToUnlock.unlock();
          }
      }
docs: 2. The lock can be locked more then once - for example in InBuffer startGetMessages() and then in ackMessages() do put() in OutBuffer and do startPutMessages()