aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-16 14:34:42 -0700
committerJohn Hurliman2009-10-16 14:34:42 -0700
commit80a8a9c4a7c9f1f0351f70f944a69650e9eca930 (patch)
tree551b0b645817189d30ad26430d861af2eed063b4 /OpenSim/Framework/Util.cs
parentPrevent oversized packets from crashing the LLUDP server. It will now print a... (diff)
downloadopensim-SC-80a8a9c4a7c9f1f0351f70f944a69650e9eca930.zip
opensim-SC-80a8a9c4a7c9f1f0351f70f944a69650e9eca930.tar.gz
opensim-SC-80a8a9c4a7c9f1f0351f70f944a69650e9eca930.tar.bz2
opensim-SC-80a8a9c4a7c9f1f0351f70f944a69650e9eca930.tar.xz
Converted FireAndForget methods to use a singleton pattern to attempt to work around a Mono bug with nested delegates
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs23
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 38729c6..3203fc1 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -44,6 +44,7 @@ using System.Xml;
44using log4net; 44using log4net;
45using Nini.Config; 45using Nini.Config;
46using Nwc.XmlRpc; 46using Nwc.XmlRpc;
47using BclExtras;
47using OpenMetaverse; 48using OpenMetaverse;
48using OpenMetaverse.StructuredData; 49using OpenMetaverse.StructuredData;
49 50
@@ -1269,14 +1270,32 @@ namespace OpenSim.Framework
1269 1270
1270 #region FireAndForget Threading Pattern 1271 #region FireAndForget Threading Pattern
1271 1272
1273 /// <summary>
1274 /// Created to work around a limitation in Mono with nested delegates
1275 /// </summary>
1276 private class FireAndForgetWrapper
1277 {
1278 public void FireAndForget(System.Threading.WaitCallback callback)
1279 {
1280 callback.BeginInvoke(null, EndFireAndForget, callback);
1281 }
1282
1283 public void FireAndForget(System.Threading.WaitCallback callback, object obj)
1284 {
1285 callback.BeginInvoke(obj, EndFireAndForget, callback);
1286 }
1287 }
1288
1272 public static void FireAndForget(System.Threading.WaitCallback callback) 1289 public static void FireAndForget(System.Threading.WaitCallback callback)
1273 { 1290 {
1274 callback.BeginInvoke(null, EndFireAndForget, callback); 1291 FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>();
1292 wrapper.FireAndForget(callback);
1275 } 1293 }
1276 1294
1277 public static void FireAndForget(System.Threading.WaitCallback callback, object obj) 1295 public static void FireAndForget(System.Threading.WaitCallback callback, object obj)
1278 { 1296 {
1279 callback.BeginInvoke(obj, EndFireAndForget, callback); 1297 FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>();
1298 wrapper.FireAndForget(callback, obj);
1280 } 1299 }
1281 1300
1282 private static void EndFireAndForget(IAsyncResult ar) 1301 private static void EndFireAndForget(IAsyncResult ar)