I want a Mutex in Java which let me to wait on it in a thread and release it in another thread. I know that I can use a Semaphore with capacity of 1 but the problem is that the “acquire()” method throws “InterruptedException”. Is there any special synchronization way for this purpose in Java?
Share
Luckily, Semaphore provides this method for you 🙂
public void acquireUninterruptibly()