Showing posts with label What is lock statement in C#. Show all posts
Showing posts with label What is lock statement in C#. Show all posts

Saturday 21 April 2012

What is lock statement in C#


What is lock statement in C#?


Lock ensures that one thread does not enter a critical section of code while another thread is in the critical section. If another thread attempts to enter a locked code, it will wait, block, until the object is released.