Interviews2 answers
What is lock statement in C#?
2 Answers
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.
Amol SarkatePosted May 31, 2015, 9:30 PM EDT
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.
Dominic RobertsPosted Nov 5, 2013, 12:09 PM EST
