android: vibrate out of the synchronized section
This commit is contained in:
parent
2d03662a9a
commit
cc26e255e0
|
@ -415,16 +415,20 @@ public class VirtualJoystickDelegate {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
while (!stopping) {
|
while (!stopping) {
|
||||||
|
boolean doVibrate;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
doVibrate = false;
|
||||||
try {
|
try {
|
||||||
this.wait();
|
this.wait();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
}
|
}
|
||||||
if (vibrate) {
|
if (vibrate) {
|
||||||
vibrator.vibrate(Emulator.vibrationDuration);
|
doVibrate = true;
|
||||||
vibrate = false;
|
vibrate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (doVibrate)
|
||||||
|
vibrator.vibrate(Emulator.vibrationDuration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue