v0.6.1: adjusted thread prioritization on multicore systems
This commit is contained in:
parent
eb06f4ff53
commit
2efda4296d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user