Hi, due to performance problems I have replaced RWL with RWLSlim but I am experiencing troubles caused by previously (with RWL) accepted statements.
As you can see, sometimes methodA calls another one which have inside ReadLock. The second method is also called from different places, so not always there is lock collision. Previously, AcquiringRead lock doesn't cause that problem. Is there any solution except from placing "if IsRWheld"? Thanks
The problem is something like that:
class a
{
methodA()
{
RWLSlimObject.TryEnterWriteLock(-1);
LockedList.Add(someItem)
methodX();
RWLSlimObject.ExitWriteLock();
}
methodX()
{
RWLSlimObject.TryEnterReadLock(-1);
//some stuff with LockedList //if called from method A, it will throw an exc.
RWLSlimObject.ExitReadLock();
}
}