I have an asp.net website where I would like to prevent concurrent access to certain pieces of code. Since every page request will get a thread of its own - that might be a problem.
If this were only one piece of code - I'd lock
it. However, there are actually several related methods. If one thread enters one of them - I'd like to prevent other threads from entering any of them.
How do I achieve that?