Compartir a través de


ICondition.AwaitUninterruptibly Method

Definition

Causes the current thread to wait until it is signalled.

[Android.Runtime.Register("awaitUninterruptibly", "()V", "GetAwaitUninterruptiblyHandler:Java.Util.Concurrent.Locks.IConditionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void AwaitUninterruptibly ();
[<Android.Runtime.Register("awaitUninterruptibly", "()V", "GetAwaitUninterruptiblyHandler:Java.Util.Concurrent.Locks.IConditionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member AwaitUninterruptibly : unit -> unit
Attributes

Remarks

Causes the current thread to wait until it is signalled.

The lock associated with this condition is atomically released and the current thread becomes disabled for thread scheduling purposes and lies dormant until <em>one</em> of three things happens: <ul> <li>Some other thread invokes the #signal method for this Condition and the current thread happens to be chosen as the thread to be awakened; or <li>Some other thread invokes the #signalAll method for this Condition; or <li>A &quot;<em>spurious wakeup</em>&quot; occurs. </ul>

In all cases, before this method can return the current thread must re-acquire the lock associated with this condition. When the thread returns it is <em>guaranteed</em> to hold this lock.

If the current thread's interrupted status is set when it enters this method, or it is Thread#interrupt interrupted while waiting, it will continue to wait until signalled. When it finally returns from this method its interrupted status will still be set.

<b>Implementation Considerations</b>

The current thread is assumed to hold the lock associated with this Condition when this method is called. It is up to the implementation to determine if this is the case and if not, how to respond. Typically, an exception will be thrown (such as IllegalMonitorStateException) and the implementation must document that fact.

Java documentation for java.util.concurrent.locks.Condition.awaitUninterruptibly().

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