R: resolve thread deadlock during bolus stop
This commit is contained in:
parent
2b2d729f42
commit
4c3e26d19c
2 changed files with 8 additions and 1 deletions
|
@ -433,7 +433,7 @@ public class DanaRExecutionService extends Service {
|
|||
}
|
||||
|
||||
final Object o = new Object();
|
||||
ConfigBuilderPlugin.getCommandQueue().readStatus("bolusingInterrupted", new Callback() {
|
||||
ConfigBuilderPlugin.getCommandQueue().independentConnect("bolusingInterrupted", new Callback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (danaRPump.lastBolusTime.getTime() > System.currentTimeMillis() - 60 * 1000L) { // last bolus max 1 min old
|
||||
|
|
|
@ -135,6 +135,13 @@ public class CommandQueue {
|
|||
}
|
||||
}
|
||||
|
||||
public static void independentConnect(String reason, Callback callback) {
|
||||
CommandQueue tempCommandQueue = new CommandQueue();
|
||||
tempCommandQueue.readStatus(reason, callback);
|
||||
QueueThread tempThread = new QueueThread(tempCommandQueue);
|
||||
tempThread.start();
|
||||
}
|
||||
|
||||
// returns true if command is queued
|
||||
public boolean bolus(DetailedBolusInfo detailedBolusInfo, Callback callback) {
|
||||
if (isRunning(Command.CommandType.BOLUS)) {
|
||||
|
|
Loading…
Reference in a new issue