public void threadReadLock(boolean prior) {
    lock.lock();
    try {
      Long allocateStamp = sharedOwnerStamp.get();
      if (allocateStamp == null) {
        // first time entry, acquire read lock and set thread local
        sharedOwnerStamp.set(acquireReadLockStamp(prior));
      } else {
        // reentry, add read count
        readCnt.put(allocateStamp, readCnt.get(allocateStamp) + 1);
      }
    } finally {
      lock.unlock();
    }
  }
Acquires the thread-bound read lock. Read lock acquire and release is thread-bound and supports
re-entry within the same thread. Return directly if no thread holds a write lock ; block and
wait if another thread holds a write lock.

@param prior If false, it will also block and wait if the write lock waiting queue is not
    empty.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/lock/StampedWriterPreferredLock.java