I have a number of threads that may call a single function, but I want to protect this function with a critical region such that if one thread is in the function all the others must wait for access.
Any ideas?
Printable View
I have a number of threads that may call a single function, but I want to protect this function with a critical region such that if one thread is in the function all the others must wait for access.
Any ideas?
SyncLock Me
'Code in here
End SyncLock
????
Even easier than that it seems - just put System.Runtime.CompilerServices.MethodImplAttribute attribute on the function signature and specify Synchronised...sweet.
Hey by the way, I'm interested in trying your EventVB thingy but the Overview page:
http://www.merrioncomputing.com/EventVB/Overview.htm
...seems to be busted. edit: aha there's the rest of the docs!
The online help is slow and combersome...you'd be as well to download the EventVB.chm compiled help file...