fix modifing m_threads on a foreach scanning it

This commit is contained in:
UbitUmarov
2015-09-05 21:23:22 +01:00
parent 2130984bef
commit 4b1ecc90fc

View File

@@ -335,7 +335,9 @@ namespace OpenSim.Framework.Monitoring
lock (m_threads)
{
foreach (ThreadWatchdogInfo threadInfo in m_threads.Values)
// get a copy since we may change m_threads
List<ThreadWatchdogInfo> threadsInfo = m_threads.Values.ToList();
foreach (ThreadWatchdogInfo threadInfo in threadsInfo)
{
if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
{