Java Reference
In-Depth Information
Listing 13.4. Locking with a Time Budget.
The canonical structure of interruptible lock acquisition is slightly more complicated than
normal lock acquisition, as two
try
blocks are needed. (If the interruptible lock acquisition
can throw
InterruptedException
, the standard
try-finally
locking idiom
responsive to interruption and so can be used when you need both timed and interruptible
lock acquisition.