Static lock As Object
SyncLock lock
TraverSingweb.TraverSingWeb.WebInvoke(Sub() TraverSingweb.TraverSingWeb.putHtmlIntoWebBrowser(theenchancedwinclient)) 'This quick function need to finish before we continue
End SyncLock
SyncLock lock
'SuperGlobal.lockMeFirst(AddressOf SuperGlobal.doNothing) ' donothing
End SyncLock
This is how I currently do in vb.net. Is this a pattern?
Here is a really basic example; the main method simply creates two threads and starts them. The first thread waits 10 seconds and then sets the _WaitHandle_FirstThreadDone. The second thread simply waits for the _WaitHandle_FirstThreadDone to be set before continuing. Both threads are started at the same time but the second thread will wait for the first thread to set the _WaitHandle_FirstThreadDone before continuing on.
See: System.Threading.AutoResetEvent for further details.