Critical regions - how to?

Merrion

Junior Contributor
Joined
Sep 29, 2001
Messages
265
Location
Dublin, Ireland
I have a single function that may be called by more than one thread at once but I want it to be a critical region i.e. if one thread is already in it make the other thread wait for the region to be freed before entering.

Any ideas?
 
If you ever need to have a smaller critical section where you want to lock access to one object, you can use the VB.NET Synclock block.
 
Back
Top