| ISemaphoreAcquire Method (Int32) |
Acquires the given number of permits, if they are available,
and returns immediately, reducing the number of available permits
by the given amount.
Namespace:
Hazelcast.Core
Assembly:
Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.12.3
Syntax void Acquire(
int permits
)
Sub Acquire (
permits As Integer
)
void Acquire(
int permits
)
abstract Acquire :
permits : int -> unit
Parameters
- permits
- Type: SystemInt32
the number of permits to acquire
Exceptions Exception | Condition |
---|
ArgumentException |
if
permits
is negative
|
InvalidOperationException | if hazelcast instance is shutdown while waiting |
Remarks
Acquires the given number of permits, if they are available,
and returns immediately, reducing the number of available permits
by the given amount.
If insufficient permits are available then the current thread becomes
disabled for thread scheduling purposes and lies dormant until
one of two things happens:
-
Some other thread invokes one of the
release
methods for this semaphore, the current thread is next to be assigned
permits and the number of available permits satisfies this request;
-
This ISemaphore instance is destroyed;
See Also