Make locking of timers and listeners in script related functions consistent

See http://opensimulator.org/mantis/view.php?id=4316
Thanks KittyLiu!
mysql-performance
Justin Clark-Casey (justincc) 2009-11-27 19:01:45 +00:00
parent 0f745e928f
commit 2e47e51475
2 changed files with 10 additions and 4 deletions

View File

@ -602,9 +602,12 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
ListenerInfo info =
ListenerInfo.FromData(localID, itemID, hostID, item);
if (!m_listeners.ContainsKey((int)item[2]))
m_listeners.Add((int)item[2], new List<ListenerInfo>());
m_listeners[(int)item[2]].Add(info);
lock (m_listeners)
{
if (!m_listeners.ContainsKey((int)item[2]))
m_listeners.Add((int)item[2], new List<ListenerInfo>());
m_listeners[(int)item[2]].Add(info);
}
idx+=6;
}

View File

@ -166,7 +166,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
ts.next = DateTime.Now.Ticks + (long)data[idx+1];
idx += 2;
Timers.Add(MakeTimerKey(localID,itemID), ts);
lock (TimerListLock)
{
Timers.Add(MakeTimerKey(localID, itemID), ts);
}
}
}
}