provides a simple and fast, reader-writer lock, does not support read->write upgrades, if you need an upgradeable lock, use UpgradeableReadWriteLocking
Syntax
Visual Basic (Declaration) | |
---|
Public Class SimpleReadWriteLocking
Implements ILockStrategy |
Example
Library/Library.Test/LockingTests/TestSimpleReadWriteLocking.cs
C# | Copy Code |
---|
Object obj = new object();
ILockStrategy l = new SimpleReadWriteLocking(obj);
using(new ThreadedWriter(l))
Assert.IsFalse(Monitor.TryEnter(obj, 0));
l.Dispose(); |
VB.NET | Copy Code |
---|
Dim obj As [Object] = New Object()
Dim l As ILockStrategy = New SimpleReadWriteLocking(obj)
Using New ThreadedWriter(l)
Assert.IsFalse(Monitor.TryEnter(obj, 0))
End Using
l.Dispose() |
Inheritance Hierarchy
System.Object
CSharpTest.Net.Synchronization.SimpleReadWriteLocking
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also