Thread.stop fallback

This commit is contained in:
tool4EvEr
2025-08-04 22:09:44 +02:00
committed by Hans Mackowiak
parent f4d304b2c1
commit 1f3871d5dc

View File

@@ -1748,7 +1748,12 @@ public class AiController {
// instead of computing all available concurrently just add a simple timeout depending on the user prefs
return future.get(game.getAITimeout(), TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
t.stop();
try {
t.stop();
} catch (UnsupportedOperationException ex) {
// Android and Java 20 dropped support to stop so sadly thread will keep running
future.cancel(true);
}
return null;
}
}