fix: 死锁.

This commit is contained in:
2025-01-02 14:37:23 +08:00
parent d5073ae245
commit 1c87acef2a

View File

@@ -175,12 +175,12 @@ public abstract class AbstractStateMachine<S> extends AbstractStateManager<S> im
return false;
}
S oldState = get();
boolean result = super.switchTo(state);
if (result) {
S newState = get();
invokeHandlers(oldState, newState);
}
return result;
updateCurrentIndex(i);
S newState = get();
invokeHandlers(oldState, newState);
return true;
} finally {
writeLock.unlock();
}