Hi everyone,
So, this isn't my code and has been shortened to show the behavior, but it is giving very unexpected results.
I have two function in a class and a lock
object mylock = new object();
List<string> temp = new List<string>();
Func1(string)
{
lock(mylock)
{
temp.Add(string);
}
}
Func2()
{
lock(mylock)
{
temp.ForEach(p => Func1(p));
}
}
Now, I know this makes no sense, but when Func2 is called, shouldn't Func1 deadlock? In our case, it executes. Thanks.