From fe1d78bb78eeb71083c59c1c00e7767c7f865a89 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 17 Aug 2008 19:17:44 +0000 Subject: Add some locking on m_undo in SceneObjectPart --- .../Region/Environment/Scenes/SceneObjectPart.cs | 40 ++++++++++++++-------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 5038afc..d6aef95 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1177,7 +1177,10 @@ namespace OpenSim.Region.Environment.Scenes public void ClearUndoState() { - m_undo.Clear(); + lock(m_undo) + { + m_undo.Clear(); + } StoreUndoState(); } @@ -2446,22 +2449,26 @@ namespace OpenSim.Region.Environment.Scenes { if (m_parentGroup != null) { - if (m_undo.Count > 0) + lock(m_undo) { - UndoState last = m_undo.Peek(); - if (last != null) + if (m_undo.Count > 0) { - if (last.Compare(this)) - return; + UndoState last = m_undo.Peek(); + if (last != null) + { + if (last.Compare(this)) + return; + } } - } + - if (m_parentGroup.GetSceneMaxUndo() > 0) - { - UndoState nUndo = new UndoState(this); + if (m_parentGroup.GetSceneMaxUndo() > 0) + { + UndoState nUndo = new UndoState(this); - m_undo.Push(nUndo); + m_undo.Push(nUndo); + } } } @@ -2951,11 +2958,14 @@ namespace OpenSim.Region.Environment.Scenes public void Undo() { - if (m_undo.Count > 0) + lock(m_undo) { - UndoState goback = m_undo.Pop(); - if (goback != null) - goback.PlaybackState(this); + if (m_undo.Count > 0) + { + UndoState goback = m_undo.Pop(); + if (goback != null) + goback.PlaybackState(this); + } } } -- cgit v1.1