What I am trying to achieve is to halt the thread and wait until doSomeProcess() is called before proceeding. But for some strange reason, the whole process got stuck at await and it never get into the Runnable.run.
Code snippet :
final CountDownLatch latch = new CountDownLatch(1);
Platform.runLater(new Runnable() {
@Override public void run() {
System.out.println("Doing some process");
doSomeProcess();
latch.countDown();
}
});
System.out.println("Await");
latch.await();
System.out.println("Done");
Console output :
Await