docs: private static void lockBoth(Lock sourceWriteLock, Lock destWriteLock) {
      while (true) {
        sourceWriteLock.lock();
        if (destWriteLock.tryLock()) {
          return;
        } else {
          sourceWriteLock.unlock();
        }
  
        destWriteLock.lock();
        if (sourceWriteLock.tryLock()) {
          return;
        } else {
          destWriteLock.unlock();
        }
      }
    }