synchronized wait

This commit is contained in:
AdrianLxM 2017-12-03 21:58:35 +01:00
parent 27436487bc
commit 42c61f4e6f

View file

@ -433,6 +433,7 @@ public class DanaRExecutionService extends Service {
}
final Object o = new Object();
synchronized(o) {
ConfigBuilderPlugin.getCommandQueue().independentConnect("bolusingInterrupted", new Callback() {
@Override
public void run() {
@ -442,14 +443,17 @@ public class DanaRExecutionService extends Service {
} else {
log.debug("Bolus amount in history too old: " + danaRPump.lastBolusTime.toLocaleString());
}
synchronized (o) {
o.notify();
}
}
});
try {
o.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} else {
ConfigBuilderPlugin.getCommandQueue().readStatus("bolusOK", null);
}