diff options
author | Diva Canto | 2009-10-07 20:36:24 -0700 |
---|---|---|
committer | Diva Canto | 2009-10-07 20:36:24 -0700 |
commit | 68961ec0923fb613eae72f0f83ad3349e608cc05 (patch) | |
tree | 05ff3bc645ddb346583cbf8b8cf7b6a0a6d8d858 /OpenSim/Region/ClientStack | |
parent | Another go at the deadlock: not locking TryGetValue, and just catch/ignore ex... (diff) | |
download | opensim-SC-68961ec0923fb613eae72f0f83ad3349e608cc05.zip opensim-SC-68961ec0923fb613eae72f0f83ad3349e608cc05.tar.gz opensim-SC-68961ec0923fb613eae72f0f83ad3349e608cc05.tar.bz2 opensim-SC-68961ec0923fb613eae72f0f83ad3349e608cc05.tar.xz |
One last attempt at tunning the locking/no locking behaviour. The previous one was too lax and made the important login packets fail.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs index 36e1f49..f6ccf01 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs | |||
@@ -247,16 +247,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
247 | 247 | ||
248 | ////return success; | 248 | ////return success; |
249 | 249 | ||
250 | //lock (m_sync) | 250 | lock (m_sync) |
251 | // return Dictionary2.TryGetValue(key, out value); | ||
252 | |||
253 | try | ||
254 | { | ||
255 | return Dictionary2.TryGetValue(key, out value); | 251 | return Dictionary2.TryGetValue(key, out value); |
256 | } | 252 | |
257 | catch { } | 253 | //try |
258 | value = null; | 254 | //{ |
259 | return false; | 255 | // return Dictionary2.TryGetValue(key, out value); |
256 | //} | ||
257 | //catch { } | ||
258 | //value = null; | ||
259 | //return false; | ||
260 | 260 | ||
261 | } | 261 | } |
262 | 262 | ||
@@ -268,8 +268,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
268 | //try { Parallel.ForEach<LLUDPClient>(Array, action); } | 268 | //try { Parallel.ForEach<LLUDPClient>(Array, action); } |
269 | //finally { if (doLock) rwLock.ExitUpgradeableReadLock(); } | 269 | //finally { if (doLock) rwLock.ExitUpgradeableReadLock(); } |
270 | 270 | ||
271 | LLUDPClient[] localArray = null; | ||
271 | lock (m_sync) | 272 | lock (m_sync) |
272 | Parallel.ForEach<LLUDPClient>(Array, action); | 273 | { |
274 | localArray = new LLUDPClient[Array.Length]; | ||
275 | Array.CopyTo(localArray, 0); | ||
276 | } | ||
277 | |||
278 | Parallel.ForEach<LLUDPClient>(localArray, action); | ||
273 | 279 | ||
274 | } | 280 | } |
275 | } | 281 | } |