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

Explain how to rename a table using sql queries?

1 Answers  


How WSDL is stored ?

1 Answers   PPS, TCS,


How to get the number after decimal point in .net?

1 Answers  


Difference between assembly manifest & metadata

2 Answers  


How to Create and Consume a Web Service?

2 Answers  


What is CCW (COM Callable Wrapper)

1 Answers  


Explain what is the difference between response.redirect & server.transfer?

1 Answers  


What are the Characteristics of .NET?

1 Answers  


Can any object be stored in a viewstate in .net?

1 Answers  


What are the new thee features of com+ services, which are not there in com (mts)?

1 Answers  


As you know read-only variables and constants have many similarities, but what is at least one way that they differ?

1 Answers  


What is the difference between reference type and value type?

1 Answers  


Categories