How can I interrupt a synchronized statement in Java?

For this kind of thing, you should use the classes in java.util.concurrent. Locks - they have far more capabilities, including interruptable locks.

Indeed you should use the locks or implement your stuff with the Object.wait(), Object.notify() and Object.notifyAll() methods (locks are actually implemented with them). Do not forget to handle the so-called 'spurious wakeups' (wait() may return even if noone called notify() or notifyAll(), so it should always be called in a loop that checks that the condition you're waiting for is satisfied).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions