Udostępnij za pośrednictwem


AbstractQueuedLongSynchronizer.ConditionObject.Await Method

Definition

Overloads

Await()

Implements interruptible condition wait.

Await(Int64, TimeUnit)

Implements timed condition wait.

Await()

Implements interruptible condition wait.

[Android.Runtime.Register("await", "()V", "")]
public void Await ();
[<Android.Runtime.Register("await", "()V", "")>]
abstract member Await : unit -> unit
override this.Await : unit -> unit

Implements

Attributes

Exceptions

Remarks

Implements interruptible condition wait. <ol> <li>If current thread is interrupted, throw InterruptedException. <li>Save lock state returned by #getState. <li>Invoke #release with saved state as argument, throwing IllegalMonitorStateException if it fails. <li>Block until signalled or interrupted. <li>Reacquire by invoking specialized version of #acquire with saved state as argument. <li>If interrupted while blocked in step 4, throw InterruptedException. </ol>

Java documentation for java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject.await().

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

Await(Int64, TimeUnit)

Implements timed condition wait.

[Android.Runtime.Register("await", "(JLjava/util/concurrent/TimeUnit;)Z", "")]
public bool Await (long time, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("await", "(JLjava/util/concurrent/TimeUnit;)Z", "")>]
abstract member Await : int64 * Java.Util.Concurrent.TimeUnit -> bool
override this.Await : int64 * Java.Util.Concurrent.TimeUnit -> bool

Parameters

time
Int64

the maximum time to wait

unit
TimeUnit

the time unit of the time argument

Returns

Implements

Attributes

Exceptions

Remarks

Implements timed condition wait. <ol> <li>If current thread is interrupted, throw InterruptedException. <li>Save lock state returned by #getState. <li>Invoke #release with saved state as argument, throwing IllegalMonitorStateException if it fails. <li>Block until signalled, interrupted, or timed out. <li>Reacquire by invoking specialized version of #acquire with saved state as argument. <li>If interrupted while blocked in step 4, throw InterruptedException. <li>If timed out while blocked in step 4, return false, else true. </ol>

Java documentation for java.util.concurrent.locks.AbstractQueuedLongSynchronizer.ConditionObject.await(long, java.util.concurrent.TimeUnit).

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