Skip to content

Commit

Permalink
Suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst committed Jul 18, 2023
1 parent ada3542 commit 7434c26
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion key.ui/src/main/java/de/uka/ilkd/key/core/Watchdog.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* Watchdog to monitor the state of the KeY system. If all worker and UI threads
* are waiting / blocked, a deadlock is reported.
* are waiting / blocked, a deadlock is reported to the log.
*
* @author Arne Keller
*/
Expand All @@ -31,6 +31,9 @@ private Watchdog() {

}

/**
* Start the watchdog in a background thread.
*/
public static void start() {
new Thread(Watchdog::run, "Watchdog").start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void stopAutoMode() {
@Override
public void waitWhileAutoMode() {
if (SwingUtilities.isEventDispatchThread()) {
LOGGER.warn("", new IllegalStateException(
LOGGER.error("", new IllegalStateException(
"tried to block the UI thread whilst waiting for auto mode to finish"));
return; // do not block the UI thread
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
public final class ThreadUtilities {
private static final Logger LOGGER = LoggerFactory.getLogger(ThreadUtilities.class);

private ThreadUtilities() {
}


/**
* Invoke a runnable object on the AWT event thread and wait for the execution to finish.
Expand Down Expand Up @@ -61,7 +64,7 @@ public static Thread[] getThreads() {
rootGroup = parentGroup;
}

Thread[] threads = new Thread[rootGroup.activeCount()];
Thread[] threads = new Thread[rootGroup.activeCount() + 1];
while (rootGroup.enumerate(threads, true) == threads.length) {
threads = new Thread[threads.length * 2];
}
Expand Down

0 comments on commit 7434c26

Please sign in to comment.