Make locking of timers and listeners in script related functions consistent
See http://opensimulator.org/mantis/view.php?id=4316 Thanks KittyLiu!mysql-performance
parent
0f745e928f
commit
2e47e51475
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue