What is java’s equivalent of ManualResetEvent? [duplicate]
class ManualResetEvent { private final Object monitor = new Object(); private volatile boolean open = false; public ManualResetEvent(boolean open) { this.open = open; } public void waitOne() throws InterruptedException { synchronized (monitor) { while (open==false) { monitor.wait(); } } } public boolean waitOne(long milliseconds) throws InterruptedException { synchronized (monitor) { if (open) return true; monitor.wait(milliseconds); … Read more