| ISemaphoreTryAcquire Method (Int32) |
Acquires the given number of permits, if they are available, and
returns immediately, with the value true,
reducing the number of available permits by the given amount.
Namespace:
Hazelcast.Core
Assembly:
Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.12.2
Syntax bool TryAcquire(
int permits
)
Function TryAcquire (
permits As Integer
) As Boolean
bool TryAcquire(
int permits
)
abstract TryAcquire :
permits : int -> bool
Parameters
- permits
- Type: SystemInt32
the number of permits to acquire
Return Value
Type:
Booleantrue
if the permits were acquired and
false
otherwise
Exceptions Exception | Condition |
---|
ArgumentException |
if
permits
is negative
|
Remarks
Acquires the given number of permits, if they are available, and
returns immediately, with the value
true,
reducing the number of available permits by the given amount.
If insufficient permits are available then this method will return
immediately with the value
false
and the number of available
permits is unchanged.
See Also