CSharpTest.Net
Create Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace > LockFactory<T> Class : Create Method

Glossary Item Box

Returns a new lock of type T

Syntax

Visual Basic (Declaration) 
Public Function Create() As ILockStrategy
C# 
public ILockStrategy Create()

Example

Library/Library.Test/LockingTests/TestReaderWriterLocking.cs

C#Copy Code
using (ILockStrategy l = LockFactory.Create())
using (l.Read())
    Assert.IsFalse(l.TryWrite(10));
VB.NETCopy Code
Using l As ILockStrategy = LockFactory.Create()
    Using l.Read()
        Assert.IsFalse(l.TryWrite(10))
    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