There is no runtime equivalent in C #. If you need to track it, you will need to implement your own shell. Also consider using Monitor.TryEnter with a timeout if your application is sensitive to blocking.
lock (object)
{
// Synchronized code
}
Translates
try
{
Monitor.Enter(object);
}
finally
{
Monitor.Exit(object);
}
code>
source
share