Skip to content

Commit

Permalink
CSSTUDIO-2412 Make runOnJavaFXThread() non-blocking.
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamwolk committed May 16, 2024
1 parent 5519c35 commit 76baacf
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,7 @@ private void runOnJavaFXThread(Runnable runnable) {
runnable.run();
}
else {
FutureTask futureTask = new FutureTask(() -> {
runnable.run();
return null;
});
Platform.runLater(() -> futureTask.run());
try {
futureTask.get();
}
catch (ExecutionException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Platform.runLater(() -> runnable.run());
}
}

Expand Down

0 comments on commit 76baacf

Please sign in to comment.