lock SenseRepeatListLock when added a new sensor during script reconstitution.

This is already being done in the other place where a sensor is added.
Adding a sensor whilst another thread is iterating over the sensor list can cause a concurrency exception.
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2012-03-02 00:22:23 +00:00
parent 9f4d772d6a
commit 0c931e3657
1 changed files with 3 additions and 1 deletions

View File

@ -583,7 +583,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
ts.next = ts.next =
DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
lock (SenseRepeatListLock)
SenseRepeaters.Add(ts); SenseRepeaters.Add(ts);
idx += 6; idx += 6;
} }
} }