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

How do you create threading in.net?

0 Answers  


What are the contents of assembly?

4 Answers   ABC, Ksb,


What are the features of UIP Application Block?

1 Answers  


i have 2 functions, int add(int a,int b); double add(int a,int b); does this code implement overloading? if not what will be the error?

4 Answers   Deloitte,


How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?

0 Answers  






Describe the programming model of a windows service

0 Answers  


If we want to write a Windows service that cannot be paused, only started and stopped. How to accomplish that?

1 Answers  


How Garbage Collector (GC) Works?

1 Answers  


What's the .net collection class that allows an element to be accessed using a unique key?

0 Answers  


why do you want to join deloitte, where do you exactly fit in.

1 Answers   Deloitte,


What's the problem with .net generics?

0 Answers  


Explain code access security.

0 Answers  


Categories