Visual Basic (Declaration) | |
---|---|
Public Function New() |
C# | |
---|---|
public SimpleReadWriteLocking() |
BPlusTree/BPlusTree.Test/TestBPlusTreeOptions.cs
C# | Copy Code |
---|---|
var options = new BPlusTree<int, int>.OptionsV2(PrimitiveSerializer.Int32, PrimitiveSerializer.Int32) { CreateFile = CreatePolicy.IfNeeded, BTreeOrder = 4 }; var copy = options.Clone(); Assert.IsFalse(Object.ReferenceEquals(options, copy)); Assert.IsFalse(Object.ReferenceEquals(options.CallLevelLock, copy.CallLevelLock)); //If we get/set the lock prior to clone we will have the same lock instance. options.CallLevelLock = new SimpleReadWriteLocking(); copy = options.Clone(); Assert.IsFalse(Object.ReferenceEquals(options, copy)); Assert.IsTrue(Object.ReferenceEquals(options.CallLevelLock, copy.CallLevelLock)); |
VB.NET | Copy Code |
---|---|
Dim options As var = New BPlusTree(Of Integer, Integer).OptionsV2(PrimitiveSerializer.Int32, PrimitiveSerializer.Int32) With { _ Key .CreateFile = CreatePolicy.IfNeeded, _ Key .BTreeOrder = 4 _ } Dim copy As var = options.Clone() Assert.IsFalse([Object].ReferenceEquals(options, copy)) Assert.IsFalse([Object].ReferenceEquals(options.CallLevelLock, copy.CallLevelLock)) 'If we get/set the lock prior to clone we will have the same lock instance. options.CallLevelLock = New SimpleReadWriteLocking() copy = options.Clone() Assert.IsFalse([Object].ReferenceEquals(options, copy)) Assert.IsTrue([Object].ReferenceEquals(options.CallLevelLock, copy.CallLevelLock)) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
SimpleReadWriteLocking ClassSimpleReadWriteLocking Members
Overload List
Used By
TestBPlusTreeOptions.TestCloneWithCallLockV1()TestBPlusTreeOptions.TestCloneWithCallLockV2()