what is object lock?



what is object lock?..

Answer / divikiran

The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock. This statement takes the following form:

Object thisLock = new Object();
lock (thisLock)
{
// Critical code section
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What is lambda expressions in c#?

0 Answers  


What is delegation in .net?

0 Answers  


What are the namespace available in .net?

0 Answers  


What is the concept of inheritance in .net?

0 Answers  


What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?

0 Answers  






What data providers available in .net to connect to database?

0 Answers  


Is there any thread in our .net programs?

0 Answers  


How will you load an assembly which is not referenced by current assembly?

0 Answers  


What are Satellite Assemblies? How you will create this? How will you get the different language strings?

3 Answers  


Will my .net app run on 64-bit windows?

0 Answers  


How many types of exception handlers are there in .NET?

2 Answers  


How to implement getcommon method in class a? Are you seeing any problem in the implementation?

0 Answers  


Categories