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; return false;
} }
S oldState = get(); S oldState = get();
boolean result = super.switchTo(state);
if (result) { updateCurrentIndex(i);
S newState = get();
invokeHandlers(oldState, newState); S newState = get();
} invokeHandlers(oldState, newState);
return result; return true;
} finally { } finally {
writeLock.unlock(); writeLock.unlock();
} }