Skip to content

Commit ba31694

Browse files
committed
Don't notify future threads if already skipped
1 parent b6bfafb commit ba31694

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/java/org/mini2Dx/miniscript/core/GameFuture.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ protected void complete() {
120120
}
121121

122122
public void skipFuture() {
123-
state.compareAndSet(STATE_NONE, STATE_FUTURE_SKIPPED);
123+
if(!state.compareAndSet(STATE_NONE, STATE_FUTURE_SKIPPED)) {
124+
return;
125+
}
124126
synchronized (this) {
125127
notifyAll();
126128
}

0 commit comments

Comments
 (0)