diff options
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 | } |