-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
JavaFX adds its own shutdown hook. That gives many problems when it is necessary to work with application,
when system is shutting down, for example, if user presses CTRL+C. As it turned out JavaFX stops working after getting kill signal. See https://bugs.openjdk.org/browse/JDK-8320923
As result, after getting kill signal this code
CountDownLatch latch = new CountDownLatch(1);
Platform.runLater(() -> latch.countDown());
latch.await();
will never complete, because lambda will never be called. So, it is necessary to check in application, how it is shutting down (if it is) what makes things more complicated.
Taking all this into consideration I suggest to add possibility to disable JavaFX shutdown thread. By other words, by default shutdown hook is used, but if there is a special system property (something like javafx.shutdownhook.disabled) with true value, then all logic of his hook will be execute Platform.exit() will be called.
This feature will allow developers to control the timing and location of JavaFX platform shutdown, which is a perfectly logical and natural requirement when working with any platform.
JavaFX adds its own shutdown hook. That gives many problems when it is necessary to work with application,
when system is shutting down, for example, if user presses CTRL+C. As it turned out JavaFX stops working after getting kill signal. See https://bugs.openjdk.org/browse/JDK-8320923
As result, after getting kill signal this code
CountDownLatch latch = new CountDownLatch(1);
Platform.runLater(() -> latch.countDown());
latch.await();
will never complete, because lambda will never be called. So, it is necessary to check in application, how it is shutting down (if it is) what makes things more complicated.
Taking all this into consideration I suggest to add possibility to disable JavaFX shutdown thread. By other words, by default shutdown hook is used, but if there is a special system property (something like javafx.shutdownhook.disabled) with true value, then all logic of his hook will be execute Platform.exit() will be called.
This feature will allow developers to control the timing and location of JavaFX platform shutdown, which is a perfectly logical and natural requirement when working with any platform.
- relates to
-
JDK-8320923 After sending kill signal to JVM JavaFX doesn't work properly
- Open