I want to write a code block where I want my thread to sleep for say 10 minutes. I can do it via Thread.sleep()
.
But, I want to release the acquired lock. So other thread can use it. I may use object.wait()
in this situation. But I can't as other thread that acquire lock does notify()
after processing. So my thread is woke up again may be prior to 10 minutes.
What I need is exact sleep of 10 minutes and Also, I do not want to hold lock. So that other threads may use it.
Please assist. Thanks