Share via


AbstractQueuedSynchronizer.Acquire(Int32) Method

Definition

Acquires in exclusive mode, ignoring interrupts.

[Android.Runtime.Register("acquire", "(I)V", "")]
public void Acquire (int arg);
[<Android.Runtime.Register("acquire", "(I)V", "")>]
member this.Acquire : 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

Remarks

Acquires in exclusive mode, ignoring interrupts. Implemented by invoking at least once #tryAcquire, returning on success. Otherwise the thread is queued, possibly repeatedly blocking and unblocking, invoking #tryAcquire until success. This method can be used to implement method Lock#lock.

Java documentation for java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(int).

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.

Applies to