共用方式為


ILock.NewCondition Method

Definition

Returns a new Condition instance that is bound to this Lock instance.

[Android.Runtime.Register("newCondition", "()Ljava/util/concurrent/locks/Condition;", "GetNewConditionHandler:Java.Util.Concurrent.Locks.ILockInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Util.Concurrent.Locks.ICondition? NewCondition ();
[<Android.Runtime.Register("newCondition", "()Ljava/util/concurrent/locks/Condition;", "GetNewConditionHandler:Java.Util.Concurrent.Locks.ILockInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member NewCondition : unit -> Java.Util.Concurrent.Locks.ICondition

Returns

A new Condition instance for this Lock instance

Attributes

Exceptions

if this Lock implementation does not support conditions

Remarks

Returns a new Condition instance that is bound to this Lock instance.

Before waiting on the condition the lock must be held by the current thread. A call to Condition#await() will atomically release the lock before waiting and re-acquire the lock before the wait returns.

<b>Implementation Considerations</b>

The exact operation of the Condition instance depends on the Lock implementation and must be documented by that implementation.

Java documentation for java.util.concurrent.locks.Lock.newCondition().

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