I have a quick question. I basically have a synchronized method which does some task when called upon so.
I use multi threads and sometimes, when the task is being executed by one thread, the thread hangs causing the synchronized method to be in blocked state indefinitely. This doesn't allow the next process to access the block.
Is there a way where I can set a timer, where after a said time ( say 60 seconds) the synchronized method gets released so other threads can still continue and not get blocked?
If there is a way, can someone please put up a sample code.
Thanks in advance!