D
DaTurk
I have a question concerning nested locks. I just noticed that I have
an object declared in my parent class that I use as the lock. But what
I noticed is that in one of the childs methods, I lock that object,
then while still in the critical section I call one of my inherited
methods, and lock the same object.
So it's esentially this
object _lock = new object();
lock(_lock)
{
lock(_lock)
{
//Do Something
}
}
Is this OK to do? It seems to be working I think.
an object declared in my parent class that I use as the lock. But what
I noticed is that in one of the childs methods, I lock that object,
then while still in the critical section I call one of my inherited
methods, and lock the same object.
So it's esentially this
object _lock = new object();
lock(_lock)
{
lock(_lock)
{
//Do Something
}
}
Is this OK to do? It seems to be working I think.