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.
iar_mods
Justin Clark-Casey (justincc) 2011-12-19 19:08:24 +00:00
parent fc9400db07
commit e8fbeeba5f
1 changed files with 6 additions and 3 deletions

View File

@ -417,11 +417,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
m_savequeue.Remove(avatarID);
}
}
}
// We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
// 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();
}
}
private void SaveAppearance(UUID agentid)
{