다음을 통해 공유


AbstractQueuedSynchronizer.TryRelease(Int32) Method

Definition

Attempts to set the state to reflect a release in exclusive mode.

[Android.Runtime.Register("tryRelease", "(I)Z", "GetTryRelease_IHandler")]
protected virtual bool TryRelease (int arg);
[<Android.Runtime.Register("tryRelease", "(I)Z", "GetTryRelease_IHandler")>]
abstract member TryRelease : int -> bool
override this.TryRelease : int -> bool

Parameters

arg
Int32

the release argument. This value is always the one passed to a release method, or the current state value upon entry to a condition wait. The value is otherwise uninterpreted and can represent anything you like.

Returns

true if this object is now in a fully released state, so that any waiting threads may attempt to acquire; and false otherwise.

Attributes

Exceptions

if releasing would place this synchronizer in an illegal state. This exception must be thrown in a consistent fashion for synchronization to work correctly.

if exclusive mode is not supported

Remarks

Attempts to set the state to reflect a release in exclusive mode.

This method is always invoked by the thread performing release.

The default implementation throws UnsupportedOperationException.

Java documentation for java.util.concurrent.locks.AbstractQueuedSynchronizer.tryRelease(int).

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