One last attempt at tunning the locking/no locking behaviour. The previous one was too lax and made the important login packets fail.

prioritization
Diva Canto 2009-10-07 20:36:24 -07:00
parent dd80380df5
commit 68961ec092
1 changed files with 16 additions and 10 deletions

View File

@ -247,16 +247,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
////return success;
//lock (m_sync)
// return Dictionary2.TryGetValue(key, out value);
try
{
lock (m_sync)
return Dictionary2.TryGetValue(key, out value);
}
catch { }
value = null;
return false;
//try
//{
// return Dictionary2.TryGetValue(key, out value);
//}
//catch { }
//value = null;
//return false;
}
@ -268,8 +268,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//try { Parallel.ForEach<LLUDPClient>(Array, action); }
//finally { if (doLock) rwLock.ExitUpgradeableReadLock(); }
LLUDPClient[] localArray = null;
lock (m_sync)
Parallel.ForEach<LLUDPClient>(Array, action);
{
localArray = new LLUDPClient[Array.Length];
Array.CopyTo(localArray, 0);
}
Parallel.ForEach<LLUDPClient>(localArray, action);
}
}