Class ReaderWriteLockExtensions
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class ReaderWriteLockExtensions : Object
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 |