Interrupt all programs on stop instead of running exit routines
This commit is contained in:
parent
f195c39db7
commit
a3167aff1e
1 changed files with 3 additions and 2 deletions
|
@ -32,7 +32,7 @@ public class Wash {
|
|||
// if the user presses button 0, and a program has been started, stop it
|
||||
|
||||
switch (n) {
|
||||
case 0 -> t = new WashingProgramStop(io, temp, water, spin);
|
||||
case 0 -> t.interrupt();
|
||||
case 1 -> t = new WashingProgram1(io, temp, water, spin);
|
||||
case 2 -> t = new WashingProgram2(io, temp, water, spin);
|
||||
case 3 -> t = new WashingProgram3(io, temp, water, spin);
|
||||
|
@ -42,7 +42,8 @@ public class Wash {
|
|||
}
|
||||
}
|
||||
|
||||
t.start();
|
||||
if (!t.isInterrupted())
|
||||
t.start();
|
||||
}
|
||||
|
||||
temp.interrupt();
|
||||
|
|
Loading…
Reference in a new issue