synchronize on final object

This commit is contained in:
Milos Kozak 2016-08-03 18:34:24 +02:00
parent c20026c15a
commit 3e5eb85b88

View file

@ -96,6 +96,7 @@ public class ExecutionService extends Service {
private Treatment bolusingTreatment = null;
private static Boolean connectionInProgress = false;
private static final Object connectionLock = new Object();
private static final UUID SPP_UUID = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");
@ -186,8 +187,8 @@ public class ExecutionService extends Service {
return;
}
final long maxConnectionTime = 5 * 60 * 1000L; // 5 min
synchronized (connectionInProgress) {
log.debug("entering connection whie loop");
synchronized (connectionLock) {
//log.debug("entering connection while loop");
connectionInProgress = true;
mWakeLock.acquire();
getBTSocketForSelectedPump();