What is lock statement in C#?

 Posted by Raja on 4/8/2008 | Category: C# Interview questions | Views: 17328

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.

Source: http://msdn2.microsoft.com/en-us/library/c5kehkcz(VS.80).aspx | Asked In: Microsoft | Alert Moderator 

Comments or Responses

Login to post response