What is lock statement in C#?
Rohan Rathore
Exclusive locking in threading ensures that one thread does not enter a critical section while another thread is in the critical section of code. If another thread attempts to enter a locked code, it will wait (block) until the object is released.
It is a syntactical sugar that wraps up a Monitor in to a try / finally block that ensures that the Monitor is closed when the coding block exits.