Fix race condition where the appearance update timer could be stopped just after another thread had started it on QueueAppearanceSave() or *Send()

However, the window for this race is very small, and the next queued appearance save or send would restart the timer anyway.
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-12-19 19:08:24 +00:00
parent 546eb88112
commit 48ea503c33
1 changed files with 6 additions and 3 deletions

View File

@ -475,10 +475,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
m_savequeue.Remove(avatarID); m_savequeue.Remove(avatarID);
} }
} }
}
if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) // We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
m_updateTimer.Stop(); // another thread inbetween the first count calls and m_updateTimer.Stop() on this thread.
lock (m_sendqueue)
if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
m_updateTimer.Stop();
}
} }
#endregion #endregion