From 172e2f4e7609c278d02ad83ca207fd79624db587 Mon Sep 17 00:00:00 2001 From: CasperW Date: Sun, 6 Dec 2009 17:23:07 +0100 Subject: Fix to existing ReaderWriterLockSlim implementations --- OpenSim/Framework/TaskInventoryDictionary.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index efe5f0c..4b9a509 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs @@ -109,7 +109,10 @@ namespace OpenSim.Framework } else { - m_itemLock.ExitReadLock(); + if (m_itemLock.RecursiveReadCount>0) + { + m_itemLock.ExitReadLock(); + } } } @@ -144,7 +147,10 @@ namespace OpenSim.Framework } else { - m_itemLock.ExitWriteLock(); + if (m_itemLock.RecursiveWriteCount > 0) + { + m_itemLock.ExitWriteLock(); + } } } -- cgit v1.1