| ICountDownLatchAwait Method |
Causes the current thread to wait until the latch has counted down to
zero, an exception is thrown, or the specified waiting time elapses.
Namespace:
Hazelcast.Core
Assembly:
Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.12.3
Syntax bool Await(
long timeout,
TimeUnit unit
)
Function Await (
timeout As Long,
unit As TimeUnit
) As Boolean
bool Await(
long long timeout,
TimeUnit unit
)
abstract Await :
timeout : int64 *
unit : TimeUnit -> bool
Parameters
- timeout
- Type: SystemInt64
the maximum time to wait - unit
- Type: Hazelcast.CoreTimeUnit
the time unit of the
argument
Return Value
Type:
Boolean
if the count reached zero and
if the waiting time elapsed before the count reached zero
Exceptions Exception | Condition |
---|
Exception | if the current thread is interrupted |
InvalidOperationException | if hazelcast instance is shutdown while waiting |
Remarks
Causes the current thread to wait until the latch has counted down to
zero, an exception is thrown, or the specified waiting time elapses.
If the current count is zero then this method returns immediately
with the value
.
If the current count is greater than zero then the current
thread becomes disabled for thread scheduling purposes and lies
dormant until one of five things happen:
-
The count reaches zero due to invocations of the
CountDown()
method;
-
This ICountDownLatch instance is destroyed;
-
The countdown owner becomes disconnected;
-
Some other thread
the current thread; or
-
The specified waiting time elapses.
If the count reaches zero then the method returns with the
value
.
If the current thread:
-
has its interrupted status set on entry to this method; or
-
is
while waiting,
then
System.Exception
is thrown and the current thread's
interrupted status is cleared.
If the specified waiting time elapses then the value
is returned. If the time is less than or equal to zero, the method
will not wait at all.
See Also