Semaphore.Acquire 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.
Overloads
| Acquire() |
Acquires a permit from this semaphore, blocking until one is available, or the thread is Thread#interrupt interrupted. |
| Acquire(Int32) |
Acquires the given number of permits from this semaphore, blocking until all are available, or the thread is Thread#interrupt interrupted. |
Acquire()
Acquires a permit from this semaphore, blocking until one is available, or the thread is Thread#interrupt interrupted.
[Android.Runtime.Register("acquire", "()V", "GetAcquireHandler")]
public virtual void Acquire ();
[<Android.Runtime.Register("acquire", "()V", "GetAcquireHandler")>]
abstract member Acquire : unit -> unit
override this.Acquire : unit -> unit
- Attributes
Exceptions
if the current thread is interrupted
Remarks
Java documentation for java.util.concurrent.Semaphore.acquire().
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
Acquire(Int32)
Acquires the given number of permits from this semaphore, blocking until all are available, or the thread is Thread#interrupt interrupted.
[Android.Runtime.Register("acquire", "(I)V", "GetAcquire_IHandler")]
public virtual void Acquire (int permits);
[<Android.Runtime.Register("acquire", "(I)V", "GetAcquire_IHandler")>]
abstract member Acquire : int -> unit
override this.Acquire : int -> unit
Parameters
- permits
- Int32
the number of permits to acquire
- Attributes
Exceptions
if the current thread is interrupted
if permits is negative
Remarks
Java documentation for java.util.concurrent.Semaphore.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.