ReaderWriterLocker Class
From Tungsten Suite
Tungsten
|
|
ReaderWriterLocker Class |
Uses ReaderWriterLockSlim to provide resource locking
Namespace: W.Threading.Lockers
Assembly: Tungsten.Threading.Lockers (in Tungsten.Threading.Lockers.dll) Version: 2.0.1
C#
public class ReaderWriterLocker : IDisposable, ILocker<ReaderWriterLockSlim>, ILocker
The ReaderWriterLocker type exposes the following members.
| Name | Description | |
|---|---|---|
| ReaderWriterLocker |
Constructs a new ReaderWriterLocker with a LockRecursionPolicy of NoRecursion
| |
| ReaderWriterLocker(LockRecursionPolicy) |
Constructs a new ReaderWriterLocker using the specified LockRecursionPolicy
|
| Name | Description | |
|---|---|---|
| Dispose |
Disposes the instance and releases resources
| |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| InLock(Action) |
Performs the action in a read lock
| |
| InLock(LockTypeEnum, Action) |
Executes an action from within a ReaderWriterLockSlim
| |
| InLockTResult(FuncTResult) |
Performs the function in a read lock
| |
| InLockTValue(LockTypeEnum, FuncTValue) |
Executes a function from within a ReaderWriterLockSlim
| |
| InLockAsync(Action) |
Asynchronously performs the action in a read lock
| |
| InLockAsync(LockTypeEnum, Action) |
Executes an action from within a ReaderWriterLockSlim
| |
| InLockAsyncTResult(FuncTResult) |
Asynchronously performs the function in a read lock
| |
| InLockAsyncTValue(LockTypeEnum, FuncTValue) |
Executes a function from within a ReaderWriterLockSlim
| |
| Lock |
Enters a read or write lock on the ReaderWriterLockSlim
| |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ToString | Returns a string that represents the current object. (Inherited from Object.) | |
| Unlock |
Exits a read or write lock on the ReaderWriterLockSlim
|
| Name | Description | |
|---|---|---|
| AsTType |
Use Generic syntax for the as operator.
(Defined by AsExtensions.) | |
| InitializeProperties | Scans the fields and properties of "owner" and sets the member's Owner property to "owner" This method should be called in the constructor of any class which has IOwnedProperty members | |
| InLock(Action) | Overloaded.
Performs the action in a Monitor lock
(Defined by MonitorExtensions.) | |
| InLockTType(FuncTType) | Overloaded.
Performs the function in a Monitor lock
(Defined by MonitorExtensions.) | |
| InLockAsync(Action) | Overloaded.
Asynchronously performs the action in a Monitor lock
(Defined by MonitorExtensions.) | |
| InLockAsyncTType(FuncTType) | Overloaded.
Asynchronously performs the action in a Monitor lock
(Defined by MonitorExtensions.) | |
| IsDirty | Scans the IsDirty value of each field and property of type IProperty | |
| Lock |
Performs a Monitor lock
(Defined by MonitorExtensions.) | |
| MarkAsClean | Scans each field and property of type IProperty and sets it's IsDirty flag to false | |
| Unlock |
Performs a Monitor unlock
(Defined by MonitorExtensions.) |
Can be overridden to provide additional functionality