CSharpTest.Net
ReadLock Constructor(ILockStrategy,Int32)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace > ReadLock Structure > ReadLock Constructor : ReadLock Constructor(ILockStrategy,Int32)

lck
timeout

Glossary Item Box

Acquires a read lock on the resource

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal lck As ILockStrategy, _
   ByVal timeout As Integer _
)
C# 
public ReadLock( 
   ILockStrategy lck,
   int timeout
)

Parameters

lck
timeout

Example

Library/Library.Test/LockingTests/TestLockingStructs.cs

C#Copy Code
using (ILockStrategy l = LockFactory.Create())
using (new ThreadedWriter(l))
using (ReadLock r = new ReadLock(l, 0))
    Assert.IsFalse(r.HasReadLock);
VB.NETCopy Code
Using l As ILockStrategy = LockFactory.Create()
    Using New ThreadedWriter(l)
        Using r As New ReadLock(l, 0)
            Assert.IsFalse(r.HasReadLock)
        End Using
    End Using
End Using

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys