CSharpTest.Net
SimpleReadWriteLocking Constructor(Object)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace > SimpleReadWriteLocking Class > SimpleReadWriteLocking Constructor : SimpleReadWriteLocking Constructor(Object)

syncRoot

Glossary Item Box

Constructs the reader-writer lock using the specified object for syncronization

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal syncRoot As Object _
)
C# 
public SimpleReadWriteLocking( 
   object syncRoot
)

Parameters

syncRoot

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()

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys