Within a HS2 vb.net script how does one provide a thread-safe block of code (critical section) within a method? The following snippet doesn't work as the Shared keyword causes a compile error in the context of the module.
Does one need to SyncLock on an object that is obtained with hs.CreateVar() and hs.GetVar()?
Thanks,
Don
Does one need to SyncLock on an object that is obtained with hs.CreateVar() and hs.GetVar()?
Code:
Shared myLock As New Object Sub mySub(ByVal param As String) SyncLock(myLock) 'Do thread safe stuff here.... End SyncLock End Sub
Don
Comment