Is there analogue of lock statement from c# in vb.net?
+13
A:
Yes, the SyncLock statement.
For example:
// C#
lock (someLock)
{
list.Add(someItem);
}
// VB
SyncLock someLock
list.Add(someItem)
End SyncLock
Jon Skeet
2009-05-27 14:00:44
Just cant compete.....:)
CSharpAtl
2009-05-27 14:05:30
+4
A:
It is called SyncLock example:
Sub IncrementWebCount()
SyncLock objMyLock
intWebHits += 1
Console.WriteLine(intWebHits)
End SyncLock
End Sub
CSharpAtl
2009-05-27 14:00:54