Roel De Nijs wrote:how would you handle an InterruptedException (if you call object.wait() you have to catch such an exception)?
1. do you just log it ?
2. do you rethrow it in a RuntimeException ?
3. defer it with Thread.currentThread().interrupt(); ? (like said in this article)
K. Tsang wrote:"Java Concurrency in Java"
Bernd Wollny wrote:thread-1 finally unlocks, but thread-2 is still in wait-state and needs some notify-call, right? totally confused now....
Yes, that's the exact reason I used in my choices.txt (a thread will keep waiting until it is cleanly woken up, by the call to notifyAll in the method unlock). And what the client sees in such a case I don't know
Surely you will react on that Interruption in a way not to proceed in lock()-method on server-side right? And what sees the client in such a case?
Roel De Nijs wrote:I know my good buddy Roberto Perillo (still waiting for invitation to sunny Brazil ) also used a thick client and I believe he wrapped the InterruptedException in a RuntimeException (but I could be wrong here and then he certainly will correct me).
Always! Wait. Never. Shut up. Look at this tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton