1
0
This commit is contained in:
2024-10-03 13:44:18 +03:00
parent 55773a4713
commit 20ddf4af59

View File

@@ -51,6 +51,9 @@ public class Main {
} catch (Exception e) { } catch (Exception e) {
System.out.println("Error executing command: " + e.getMessage()); System.out.println("Error executing command: " + e.getMessage());
} }
if (Thread.interrupted())
isRunning = false;
} }
} }
@@ -123,6 +126,7 @@ public class Main {
System.out.println("Result: " + thread.getResult()); System.out.println("Result: " + thread.getResult());
} catch (InterruptedException e) { } catch (InterruptedException e) {
System.out.println("Thread was interrupted while awaiting: " + e.getMessage()); System.out.println("Thread was interrupted while awaiting: " + e.getMessage());
Thread.currentThread().interrupt();
} }
} }