Java Reference
In-Depth Information
13.1.2. Interruptible Lock Acquisition
Just as timed lock acquisition allows exclusive locking to be used within timelimited activ-
ities, interruptible lock acquisition allows locking to be used within cancellable activities.
Section 7.1.6
identified several mechanisms, such as acquiring an intrinsic lock, that are not
responsive to interruption. These noninterruptible blocking mechanisms complicate the im-
plementation of cancellable tasks. The
lockInterruptibly
method allows you to try to
acquire a lock while remaining responsive to interruption, and its inclusion in
Lock
avoids
creating another category of non-interruptible blocking mechanisms.