Class ReaderWriterLockStrategy
Provides read/write locking.
Inheritance
Namespace: DotNetNuke.Collections.Internal
Assembly: DotNetNuke.dll
Syntax
public class ReaderWriterLockStrategy : IDisposable, ILockStrategy
Constructors
| Improve this Doc View SourceReaderWriterLockStrategy()
Initializes a new instance of the ReaderWriterLockStrategy class.
Declaration
public ReaderWriterLockStrategy()
ReaderWriterLockStrategy(LockRecursionPolicy)
Initializes a new instance of the ReaderWriterLockStrategy class.
Declaration
public ReaderWriterLockStrategy(LockRecursionPolicy recursionPolicy)
Parameters
Type | Name | Description |
---|---|---|
LockRecursionPolicy | recursionPolicy | An instance of a |
ReaderWriterLockStrategy(SerializationInfo, StreamingContext)
Initializes a new instance of the ReaderWriterLockStrategy class. The special constructor is used to deserialize values.
Declaration
public ReaderWriterLockStrategy(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A |
StreamingContext | context | The streaming context to use. |
Properties
| Improve this Doc View SourceSupportsConcurrentReads
Gets a value indicating whether the lock strategy supports concurrent reads.
Declaration
public bool SupportsConcurrentReads { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ThreadCanRead
Gets a value indicating whether the thread can read.
Declaration
public bool ThreadCanRead { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ThreadCanWrite
Gets a value indicating whether the thread can write.
Declaration
public bool ThreadCanWrite { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceDispose()
Provides read/write locking.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes this instance resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | A value indicating whether this instance is currently disposing. |
Finalize()
Finalizes an instance of the ReaderWriterLockStrategy class.
Declaration
protected void Finalize()
GetObjectData(SerializationInfo, StreamingContext)
Implement this method to serialize data. The method is called on serialization.
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | The |
StreamingContext | context | The |
GetReadLock()
Gets a read lock.
Declaration
public ISharedCollectionLock GetReadLock()
Returns
Type | Description |
---|---|
ISharedCollectionLock |
GetReadLock(TimeSpan)
Gets a read lock with the specified timeout.
Declaration
public ISharedCollectionLock GetReadLock(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout | The timeout for this lock. |
Returns
Type | Description |
---|---|
ISharedCollectionLock |
GetWriteLock()
Gets a write lock.
Declaration
public ISharedCollectionLock GetWriteLock()
Returns
Type | Description |
---|---|
ISharedCollectionLock |
GetWriteLock(TimeSpan)
Gets a write lock with the specified timeout.
Declaration
public ISharedCollectionLock GetWriteLock(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout | The timeout for this lock. |
Returns
Type | Description |
---|---|
ISharedCollectionLock |