CSharpTest.Net
SimpleReadWriteLocking Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace : SimpleReadWriteLocking Class

Glossary Item Box

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 
C# 
public class SimpleReadWriteLocking : 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.NETCopy 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

Generated with Document! X 2011 by Innovasys