locking issue

LSLKeyTest
UbitUmarov 2016-08-22 06:50:20 +01:00
parent 3ffb6e8120
commit b98b535a6b
1 changed files with 18 additions and 18 deletions

View File

@ -345,6 +345,7 @@ namespace OpenSim.Region.Framework.Scenes
private string m_text = String.Empty; private string m_text = String.Empty;
private string m_touchName = String.Empty; private string m_touchName = String.Empty;
private UndoRedoState m_UndoRedo = null; private UndoRedoState m_UndoRedo = null;
private object m_UndoLock = new object();
private bool m_passTouches = false; private bool m_passTouches = false;
private bool m_passCollisions = false; private bool m_passCollisions = false;
@ -399,13 +400,12 @@ namespace OpenSim.Region.Framework.Scenes
// 0 for default collision sounds, -1 for script disabled sound 1 for script defined sound // 0 for default collision sounds, -1 for script disabled sound 1 for script defined sound
private sbyte m_collisionSoundType; private sbyte m_collisionSoundType = 0;
private UUID m_collisionSound; private UUID m_collisionSound;
private float m_collisionSoundVolume; private float m_collisionSoundVolume;
private int LastColSoundSentTime; private int LastColSoundSentTime;
private SOPVehicle m_vehicleParams = null; private SOPVehicle m_vehicleParams = null;
public KeyframeMotion KeyframeMotion public KeyframeMotion KeyframeMotion
@ -3931,12 +3931,12 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
} }
public void StoreUndoState(ObjectChangeType change) public void StoreUndoState(ObjectChangeType change)
{
lock (m_UndoLock)
{ {
if (m_UndoRedo == null) if (m_UndoRedo == null)
m_UndoRedo = new UndoRedoState(5); m_UndoRedo = new UndoRedoState(5);
lock (m_UndoRedo)
{
if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended
{ {
m_UndoRedo.StoreUndo(this, change); m_UndoRedo.StoreUndo(this, change);
@ -3958,12 +3958,12 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
} }
public void Undo() public void Undo()
{
lock (m_UndoLock)
{ {
if (m_UndoRedo == null || Undoing || ParentGroup == null) if (m_UndoRedo == null || Undoing || ParentGroup == null)
return; return;
lock (m_UndoRedo)
{
Undoing = true; Undoing = true;
m_UndoRedo.Undo(this); m_UndoRedo.Undo(this);
Undoing = false; Undoing = false;
@ -3971,12 +3971,12 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
} }
public void Redo() public void Redo()
{
lock (m_UndoLock)
{ {
if (m_UndoRedo == null || Undoing || ParentGroup == null) if (m_UndoRedo == null || Undoing || ParentGroup == null)
return; return;
lock (m_UndoRedo)
{
Undoing = true; Undoing = true;
m_UndoRedo.Redo(this); m_UndoRedo.Redo(this);
Undoing = false; Undoing = false;
@ -3984,12 +3984,12 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
} }
public void ClearUndoState() public void ClearUndoState()
{
lock (m_UndoLock)
{ {
if (m_UndoRedo == null || Undoing) if (m_UndoRedo == null || Undoing)
return; return;
lock (m_UndoRedo)
{
m_UndoRedo.Clear(); m_UndoRedo.Clear();
} }
} }