fix modifing m_threads on a foreach scanning it

avinationmerge
UbitUmarov 2015-09-05 21:23:22 +01:00
parent 2130984bef
commit 4b1ecc90fc
1 changed files with 3 additions and 1 deletions

View File

@ -335,7 +335,9 @@ namespace OpenSim.Framework.Monitoring
lock (m_threads) 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) if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
{ {