v0.6.1: adjusted thread prioritization on multicore systems
This commit is contained in:
@@ -482,8 +482,10 @@ public class GameScene extends PixelScene {
|
|||||||
|
|
||||||
if (!Actor.processing() && Dungeon.hero.isAlive()) {
|
if (!Actor.processing() && Dungeon.hero.isAlive()) {
|
||||||
if (!actorThread.isAlive()) {
|
if (!actorThread.isAlive()) {
|
||||||
//if cpu time is limited, game should prefer drawing the current frame
|
//if cpu cores are limited, game should prefer drawing the current frame
|
||||||
actorThread.setPriority(Thread.NORM_PRIORITY - 1);
|
if (Runtime.getRuntime().availableProcessors() == 1) {
|
||||||
|
actorThread.setPriority(Thread.NORM_PRIORITY - 1);
|
||||||
|
}
|
||||||
actorThread.start();
|
actorThread.start();
|
||||||
} else {
|
} else {
|
||||||
synchronized (actorThread) {
|
synchronized (actorThread) {
|
||||||
|
|||||||
Reference in New Issue
Block a user