diff options
-rw-r--r-- | src/com/jsyn/engine/SynthesisEngine.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/jsyn/engine/SynthesisEngine.java b/src/com/jsyn/engine/SynthesisEngine.java index c79083e..b49e78e 100644 --- a/src/com/jsyn/engine/SynthesisEngine.java +++ b/src/com/jsyn/engine/SynthesisEngine.java @@ -233,7 +233,9 @@ public class SynthesisEngine implements Synthesizer { engineThread = new EngineThread(inputDeviceID, numInputChannels, outputDeviceID, numOutputChannels); logger.fine("Synth thread old priority = " + engineThread.getPriority()); - engineThread.setPriority(engineThread.getPriority() + 2); + int engineThreadPriority = engineThread.getPriority() + 2 > Thread.MAX_PRIORITY ? + Thread.MAX_PRIORITY : engineThread.getPriority() + 2; + engineThread.setPriority(engineThreadPriority); logger.fine("Synth thread new priority = " + engineThread.getPriority()); engineThread.start(); } |