v0.6.1: adjusted thread prioritization on multicore systems

This commit is contained in:
Evan Debenham 2017-08-15 01:07:59 -04:00
parent eb06f4ff53
commit 2efda4296d

View File

@ -482,8 +482,10 @@ public class GameScene extends PixelScene {
if (!Actor.processing() && Dungeon.hero.isAlive()) {
if (!actorThread.isAlive()) {
//if cpu time is limited, game should prefer drawing the current frame
actorThread.setPriority(Thread.NORM_PRIORITY - 1);
//if cpu cores are limited, game should prefer drawing the current frame
if (Runtime.getRuntime().availableProcessors() == 1) {
actorThread.setPriority(Thread.NORM_PRIORITY - 1);
}
actorThread.start();
} else {
synchronized (actorThread) {