Show / Hide Table of Contents

Class ReaderWriteLockExtensions

Inheritance
object
ReaderWriteLockExtensions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class ReaderWriteLockExtensions

Methods

WithReaderLock(ReaderWriterLock, Action)

Perform the body of actions within a read-lock context, using the given ReaderWriterLock.

Declaration
public static void WithReaderLock(this ReaderWriterLock theLock, Action body)
Parameters
Type Name Description
ReaderWriterLock theLock

Lock object to operate on

Action body

Actions to perform within the lock

WithReaderLock<TResult>(ReaderWriterLock, Func<TResult>)

Declaration
public static TResult WithReaderLock<TResult>(this ReaderWriterLock theLock, Func<TResult> body)
Parameters
Type Name Description
ReaderWriterLock theLock
Func<TResult> body
Returns
Type Description
TResult
Type Parameters
Name Description
TResult

WithWriterLock(ReaderWriterLock, Action)

Perform the body of actions within a write-lock context, using the given ReaderWriterLock. If the thread already has a reader lock, then it will be upgraded to a writer lock, and restored on exit.

Declaration
public static void WithWriterLock(this ReaderWriterLock theLock, Action body)
Parameters
Type Name Description
ReaderWriterLock theLock

Lock object to operate on

Action body

Actions to perform within the lock

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top