Hi there,
I have a lock in my code.
I have two threads running at the same time.
How can I tell if a thread is locking that object?
private readonly object _lockObject = new Object();
// Both methods running
public void Method1()
{
if(certainCriteria)
{
lock(_lockObject)
{
//doWork;
}
}
}
// Both methods running
public void Method2()
{
if( isLocked?(_lockObject))
{
//doWork;
}
}
Has anyone got the isLocked? method?
Thanks in advance!