AbstractQueuedSynchronizer.AcquireInterruptibly(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Acquires in exclusive mode, aborting if interrupted.
[Android.Runtime.Register("acquireInterruptibly", "(I)V", "")]
public void AcquireInterruptibly (int arg);
[<Android.Runtime.Register("acquireInterruptibly", "(I)V", "")>]
member this.AcquireInterruptibly : int -> unit
Parameters
- arg
- Int32
the acquire argument. This value is conveyed to
#tryAcquire
but is otherwise uninterpreted and
can represent anything you like.
- Attributes
Exceptions
if the current thread is interrupted
Remarks
Acquires in exclusive mode, aborting if interrupted. Implemented by first checking interrupt status, then invoking at least once #tryAcquire
, returning on success. Otherwise the thread is queued, possibly repeatedly blocking and unblocking, invoking #tryAcquire
until success or the thread is interrupted. This method can be used to implement method Lock#lockInterruptibly
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.