ReaderWriterLock ClassApache log4net™ SDK Documentation
Defines a lock that supports single writers and multiple readers
Inheritance Hierarchy

SystemObject
  log4net.UtilReaderWriterLock

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

public sealed class ReaderWriterLock

The ReaderWriterLock type exposes the following members.

Constructors

  NameDescription
Public methodReaderWriterLock
Constructor
Top
Methods

  NameDescription
Public methodAcquireReaderLock
Acquires a reader lock
Public methodAcquireWriterLock
Acquires the writer lock
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodReleaseReaderLock
Decrements the lock count
Public methodReleaseWriterLock
Decrements the lock count on the writer lock
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Remarks

ReaderWriterLock is used to synchronize access to a resource. At any given time, it allows either concurrent read access for multiple threads, or write access for a single thread. In a situation where a resource is changed infrequently, a ReaderWriterLock provides better throughput than a simple one-at-a-time lock, such as Monitor.

If a platform does not support a System.Threading.ReaderWriterLock implementation then all readers and writers are serialized. Therefore the caller must not rely on multiple simultaneous readers.

See Also

Reference