I'm probably raising the old problem, the matter is the infamous InterruptedException.
I've carefully read this thread, apparently it makes sense for me.
However, here is where I'm kinda stuck. I have the following lock method signature:
So I'm going to implement the method something like this:
I'm pondering what to do in the catch block after re-interruption. I guess I can't leave it as is since a thread will break through my wait/notify defence after re-interruption. So the 2 options I'm considering are:
1) kick a thread back to waiting state immediately after re-interruption (I feel it contradicts the common sense of interruption)
2) throw a runtime exception after re-interruption (and here I'm afraid I can violate the requirement that a thread should always wait until a locked record becomes available).
Could you give me an argument in favor of one of these alternatives to help me make a final decision? (or there can be the 3rd way?)