aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorBlueWall2011-01-13 11:39:50 -0500
committerMelanie2011-01-13 19:52:34 +0000
commit69c8cc787f0bcecd617aeeff3d2776ba159d82ee (patch)
tree8ad79e288e7fd603511a8ea0159f517d5faf8f2a
parentDont' trust the viewer! Fix a permission slam error caused by trusting (diff)
downloadopensim-SC_OLD-69c8cc787f0bcecd617aeeff3d2776ba159d82ee.zip
opensim-SC_OLD-69c8cc787f0bcecd617aeeff3d2776ba159d82ee.tar.gz
opensim-SC_OLD-69c8cc787f0bcecd617aeeff3d2776ba159d82ee.tar.bz2
opensim-SC_OLD-69c8cc787f0bcecd617aeeff3d2776ba159d82ee.tar.xz
Make FireAndForgetWrapper a singleton class
Made FireAndForgetWrapper a singleton class to allow us to drop dependancy on the BclExtras35 library. BclExtras is broken in Mono 2.8.2 and we used the library in only one function.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs27
-rw-r--r--bin/BclExtras35.dllbin153600 -> 0 bytes
-rw-r--r--prebuild.xml2
3 files changed, 24 insertions, 5 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 8d1671a..d1d8736 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -46,7 +46,7 @@ using System.Threading;
46using log4net; 46using log4net;
47using Nini.Config; 47using Nini.Config;
48using Nwc.XmlRpc; 48using Nwc.XmlRpc;
49using BclExtras; 49// using BclExtras;
50using OpenMetaverse; 50using OpenMetaverse;
51using OpenMetaverse.StructuredData; 51using OpenMetaverse.StructuredData;
52using Amib.Threading; 52using Amib.Threading;
@@ -1375,8 +1375,29 @@ namespace OpenSim.Framework
1375 /// <summary> 1375 /// <summary>
1376 /// Created to work around a limitation in Mono with nested delegates 1376 /// Created to work around a limitation in Mono with nested delegates
1377 /// </summary> 1377 /// </summary>
1378 private class FireAndForgetWrapper 1378 private sealed class FireAndForgetWrapper
1379 { 1379 {
1380 private static volatile FireAndForgetWrapper instance;
1381 private static object syncRoot = new Object();
1382
1383 public static FireAndForgetWrapper Instance {
1384 get {
1385
1386 if (instance == null)
1387 {
1388 lock (syncRoot)
1389 {
1390 if (instance == null)
1391 {
1392 instance = new FireAndForgetWrapper();
1393 }
1394 }
1395 }
1396
1397 return instance;
1398 }
1399 }
1400
1380 public void FireAndForget(System.Threading.WaitCallback callback) 1401 public void FireAndForget(System.Threading.WaitCallback callback)
1381 { 1402 {
1382 callback.BeginInvoke(null, EndFireAndForget, callback); 1403 callback.BeginInvoke(null, EndFireAndForget, callback);
@@ -1445,7 +1466,7 @@ namespace OpenSim.Framework
1445 ThreadPool.QueueUserWorkItem(callback, obj); 1466 ThreadPool.QueueUserWorkItem(callback, obj);
1446 break; 1467 break;
1447 case FireAndForgetMethod.BeginInvoke: 1468 case FireAndForgetMethod.BeginInvoke:
1448 FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>(); 1469 FireAndForgetWrapper wrapper = FireAndForgetWrapper.Instance;
1449 wrapper.FireAndForget(callback, obj); 1470 wrapper.FireAndForget(callback, obj);
1450 break; 1471 break;
1451 case FireAndForgetMethod.SmartThreadPool: 1472 case FireAndForgetMethod.SmartThreadPool:
diff --git a/bin/BclExtras35.dll b/bin/BclExtras35.dll
deleted file mode 100644
index 7a7480a..0000000
--- a/bin/BclExtras35.dll
+++ /dev/null
Binary files differ
diff --git a/prebuild.xml b/prebuild.xml
index 48bb2d3..854149b 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -158,7 +158,6 @@
158 <Reference name="System.Data"/> 158 <Reference name="System.Data"/>
159 <Reference name="System.Drawing"/> 159 <Reference name="System.Drawing"/>
160 <Reference name="System.Web"/> 160 <Reference name="System.Web"/>
161 <Reference name="BclExtras35" path="../../bin/"/>
162 <Reference name="OpenMetaverseTypes" path="../../bin/"/> 161 <Reference name="OpenMetaverseTypes" path="../../bin/"/>
163 <Reference name="OpenMetaverse" path="../../bin/"/> 162 <Reference name="OpenMetaverse" path="../../bin/"/>
164 <Reference name="OpenMetaverse.StructuredData" path="../../bin/"/> 163 <Reference name="OpenMetaverse.StructuredData" path="../../bin/"/>
@@ -1597,7 +1596,6 @@
1597 <Reference name="OpenSim.Region.ClientStack"/> 1596 <Reference name="OpenSim.Region.ClientStack"/>
1598 <Reference name="OpenSim.Region.Physics.Manager"/> 1597 <Reference name="OpenSim.Region.Physics.Manager"/>
1599 <Reference name="OpenSim.Services.Interfaces"/> 1598 <Reference name="OpenSim.Services.Interfaces"/>
1600 <Reference name="BclExtras35" path="../../../../bin/"/>
1601 <Reference name="XMLRPC" path="../../../../bin/"/> 1599 <Reference name="XMLRPC" path="../../../../bin/"/>
1602 <Reference name="Nini" path="../../../../bin/"/> 1600 <Reference name="Nini" path="../../../../bin/"/>
1603 <Reference name="log4net" path="../../../../bin/"/> 1601 <Reference name="log4net" path="../../../../bin/"/>