* Some minor changes to sleep command (fixes #2992).

This commit is contained in:
LevelX2 2017-04-02 11:32:25 +02:00
parent 4c35650b2b
commit 5a072ea760
12 changed files with 133 additions and 140 deletions

View file

@ -1,7 +1,8 @@
package mage.client.util.audio;
import java.io.File;
import java.awt.List;
import java.io.File;
import java.util.concurrent.TimeUnit;
import javax.sound.sampled.*;
import mage.client.constants.Constants;
import mage.client.dialog.PreferencesDialog;
@ -75,7 +76,7 @@ public class MusicPlayer {
player.breaked_out = true;
player.breaked = true;
try {
Thread.sleep(100);
TimeUnit.MILLISECONDS.sleep(100);
} catch (Exception e) {
log.error("Thread error: " + e);
}
@ -119,7 +120,7 @@ public class MusicPlayer {
public void run() {
try {
Thread.sleep(100);
TimeUnit.MILLISECONDS.sleep(100);
} catch (Exception e) {
}
while (!stopped) {
@ -130,7 +131,7 @@ public class MusicPlayer {
PlayThread.start();
while (!(breaked || breaked_out)) {
try {
Thread.sleep(10);
TimeUnit.MILLISECONDS.sleep(10);
} catch (Exception e) {
log.error("Thread error: " + e);
}