Tag: Lock keyword
Lock keyword in C#
Want to get the mutual exclusion lock for a given object or a block of statement? If yes, you can use the lock keyword in C# which marks the start of the critical section. The lock keyword may be useful especially when you are using threading in your application. It ensures that only one thread can enter and use the critical section. If another thread…