add lock
parent
182e7c7234
commit
c75eacd7d1
|
@ -170,11 +170,14 @@ namespace OpenSim.Modules.PathFinding
|
|||
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
|
||||
|
||||
if (_env != null)
|
||||
{
|
||||
lock(_env)
|
||||
{
|
||||
_env.LastTimeUsed = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
|
||||
}
|
||||
|
@ -191,6 +194,8 @@ namespace OpenSim.Modules.PathFinding
|
|||
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
|
||||
|
||||
if (_env != null)
|
||||
{
|
||||
lock(_env)
|
||||
{
|
||||
List<PathNode> _nodes = _env.Nodes.FindAll(X => X.Target == true);
|
||||
|
||||
|
@ -200,6 +205,7 @@ namespace OpenSim.Modules.PathFinding
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception _error)
|
||||
{
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
|
||||
|
@ -213,6 +219,8 @@ namespace OpenSim.Modules.PathFinding
|
|||
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
|
||||
|
||||
if (_env != null)
|
||||
{
|
||||
lock(_env)
|
||||
{
|
||||
if (isTarget == 1)
|
||||
removeAllTargets(requestData);
|
||||
|
@ -239,6 +247,7 @@ namespace OpenSim.Modules.PathFinding
|
|||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
|
||||
}
|
||||
|
@ -255,6 +264,8 @@ namespace OpenSim.Modules.PathFinding
|
|||
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
|
||||
|
||||
if (_env != null)
|
||||
{
|
||||
lock(_env)
|
||||
{
|
||||
if ((int)start.X == (int)target.X || (int)start.Y == (int)target.Y)
|
||||
{
|
||||
|
@ -313,6 +324,7 @@ namespace OpenSim.Modules.PathFinding
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
|
||||
|
|
Loading…
Reference in New Issue