mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Thread.stop fallback
This commit is contained in:
committed by
Hans Mackowiak
parent
f4d304b2c1
commit
1f3871d5dc
@@ -1748,7 +1748,12 @@ public class AiController {
|
|||||||
// instead of computing all available concurrently just add a simple timeout depending on the user prefs
|
// instead of computing all available concurrently just add a simple timeout depending on the user prefs
|
||||||
return future.get(game.getAITimeout(), TimeUnit.SECONDS);
|
return future.get(game.getAITimeout(), TimeUnit.SECONDS);
|
||||||
} catch (InterruptedException | ExecutionException | TimeoutException e) {
|
} 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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user