public final ProcedureLockState doAcquireLock(Env env, IProcedureStore store) {
    if (lockedWhenLoading) {
      lockedWhenLoading = false;
      locked = true;
      return ProcedureLockState.LOCK_ACQUIRED;
    }
    ProcedureLockState state = acquireLock(env);
    if (state == ProcedureLockState.LOCK_ACQUIRED) {
      locked = true;
      store.update(this);
    }
    return state;
  }
Internal method called by the ProcedureExecutor that starts the user-level code acquireLock().

@param env environment
@param store ProcedureStore
@return ProcedureLockState
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/Procedure.java