What is the recommended / best way to implement a blocking function call in Java, that can be later unblocked by a call from another thread?
Basically I want to have
You can use a CountDownLatch.
latch = new CountDownLatch(1);
To block, call:
latch.await();
To unblock, call:
latch.countDown();