ReentrantReadWriteLock Class

Definition

An implementation of ReadWriteLock supporting similar semantics to ReentrantLock.

[Android.Runtime.Register("java/util/concurrent/locks/ReentrantReadWriteLock", DoNotGenerateAcw=true)]
public class ReentrantReadWriteLock : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Util.Concurrent.Locks.IReadWriteLock
[<Android.Runtime.Register("java/util/concurrent/locks/ReentrantReadWriteLock", DoNotGenerateAcw=true)>]
type ReentrantReadWriteLock = class
    inherit Object
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IReadWriteLock
Inheritance
ReentrantReadWriteLock
Attributes
Implements

Remarks

Java documentation for java.util.concurrent.locks.ReentrantReadWriteLock.

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.

Constructors

ReentrantReadWriteLock()

Creates a new ReentrantReadWriteLock with default (nonfair) ordering properties.

ReentrantReadWriteLock(Boolean)

Creates a new ReentrantReadWriteLock with the given fairness policy.

ReentrantReadWriteLock(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasQueuedThreads

Queries whether any threads are waiting to acquire the read or write lock.

IsFair

Returns true if this lock has fairness set true.

IsWriteLocked

Queries if the write lock is held by any thread.

IsWriteLockedByCurrentThread

Queries if the write lock is held by the current thread.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Owner

Returns the thread that currently owns the write lock, or null if not owned.

PeerReference (Inherited from Object)
QueuedReaderThreads

Returns a collection containing threads that may be waiting to acquire the read lock.

QueuedThreads

Returns a collection containing threads that may be waiting to acquire either the read or write lock.

QueuedWriterThreads

Returns a collection containing threads that may be waiting to acquire the write lock.

QueueLength

Returns an estimate of the number of threads waiting to acquire either the read or write lock.

ReadHoldCount

Queries the number of reentrant read holds on this lock by the current thread.

ReadLockCount

Queries the number of read locks held for this lock.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

WriteHoldCount

Queries the number of reentrant write holds on this lock by the current thread.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetWaitingThreads(ICondition)

Returns a collection containing those threads that may be waiting on the given condition associated with the write lock.

GetWaitQueueLength(ICondition)

Returns an estimate of the number of threads waiting on the given condition associated with the write lock.

HasQueuedThread(Thread)

Queries whether the given thread is waiting to acquire either the read or write lock.

HasWaiters(ICondition)

Queries whether any threads are waiting on the given condition associated with the write lock.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
ReadLock()

Returns the lock used for reading.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until either another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or a specified amount of time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

(Inherited from Object)
WriteLock()

Returns the lock used for writing.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to