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 strong name?

2 Answers  


what all type of application can u make with visual studio?

3 Answers   Manhattan,


What are object pooling and connection pooling and difference?

3 Answers   TCS,


How do you turn off cookies for one page in your site? Give an example.

0 Answers  


Difference between machine.config and web.config?

0 Answers  






what is a strong name?

3 Answers  


Do you know what is lambda expressions in c#?

0 Answers  


Please explain what inheritance is, and why it's important?

0 Answers  


Which Namespace is used to to achieve MultiThreading in .NET?

0 Answers  


What is garbage collection and how it works. Provide a code example of how you can enforce garbage collection in .net?

0 Answers  


Is .net capable of supporting multi-thread?

0 Answers  


What is difference between .net and .net core?

0 Answers  


Categories