what is object lock?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What exactly is being serialized when you perform serialization in .net?

535


How many namespaces are in .net version 1.1?

607


Explain me what is the difference between a class and an object, and how do these terms relate to each other?

503


What is the use of activex control in .net?

583


Is .net 4.8 backwards compatible?

542






How can you turn-on and turn-off cas?

550


What is common type system (cts)?

556


SAP Business One(this is intigrated tool of .net)

1777


What are the purposes of using .net?

604


Difference between class and interface in .net?

589


Explain different types of html, web and server controls.

565


What is .net latest version?

543


how can i create a table from front end to back end in wabe page?

1497


What is the difference between function and stored procedure?

586


Is .net core free?

567