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/Region/ScriptEngine/XEngine/XEngine.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 49c69ab..184af19 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -150,7 +150,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine } else { - m_scriptsLock.ExitReadLock(); + if (m_scriptsLock.RecursiveReadCount > 0) + { + m_scriptsLock.ExitReadLock(); + } } } private void lockScriptsForWrite(bool locked) @@ -179,7 +182,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine } else { - m_scriptsLock.ExitWriteLock(); + if (m_scriptsLock.RecursiveWriteCount > 0) + { + m_scriptsLock.ExitWriteLock(); + } } } -- cgit v1.1