Share via


AbstractQueuedSynchronizer.TryReleaseShared(Int32) Method

Definition

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

[Android.Runtime.Register("tryReleaseShared", "(I)Z", "GetTryReleaseShared_IHandler")]
protected virtual bool TryReleaseShared (int arg);
[<Android.Runtime.Register("tryReleaseShared", "(I)Z", "GetTryReleaseShared_IHandler")>]
abstract member TryReleaseShared : int -> bool
override this.TryReleaseShared : 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 release of shared mode may permit a waiting acquire (shared or exclusive) to succeed; 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 shared mode is not supported

Remarks

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

This method is always invoked by the thread performing release.

The default implementation throws UnsupportedOperationException.

Java documentation for java.util.concurrent.locks.AbstractQueuedSynchronizer.tryReleaseShared(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