Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2011-01-13 19:53:44 +00:00
commit 3fc5b6a8ec
3 changed files with 24 additions and 5 deletions

View File

@ -46,7 +46,7 @@ using System.Threading;
using log4net;
using Nini.Config;
using Nwc.XmlRpc;
using BclExtras;
// using BclExtras;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using Amib.Threading;
@ -1375,8 +1375,29 @@ namespace OpenSim.Framework
/// <summary>
/// Created to work around a limitation in Mono with nested delegates
/// </summary>
private class FireAndForgetWrapper
private sealed class FireAndForgetWrapper
{
private static volatile FireAndForgetWrapper instance;
private static object syncRoot = new Object();
public static FireAndForgetWrapper Instance {
get {
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
{
instance = new FireAndForgetWrapper();
}
}
}
return instance;
}
}
public void FireAndForget(System.Threading.WaitCallback callback)
{
callback.BeginInvoke(null, EndFireAndForget, callback);
@ -1445,7 +1466,7 @@ namespace OpenSim.Framework
ThreadPool.QueueUserWorkItem(callback, obj);
break;
case FireAndForgetMethod.BeginInvoke:
FireAndForgetWrapper wrapper = Singleton.GetInstance<FireAndForgetWrapper>();
FireAndForgetWrapper wrapper = FireAndForgetWrapper.Instance;
wrapper.FireAndForget(callback, obj);
break;
case FireAndForgetMethod.SmartThreadPool:

Binary file not shown.

View File

@ -158,7 +158,6 @@
<Reference name="System.Data"/>
<Reference name="System.Drawing"/>
<Reference name="System.Web"/>
<Reference name="BclExtras35" path="../../bin/"/>
<Reference name="OpenMetaverseTypes" path="../../bin/"/>
<Reference name="OpenMetaverse" path="../../bin/"/>
<Reference name="OpenMetaverse.StructuredData" path="../../bin/"/>
@ -1628,7 +1627,6 @@
<Reference name="OpenSim.Region.ClientStack"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Services.Interfaces"/>
<Reference name="BclExtras35" path="../../../../bin/"/>
<Reference name="XMLRPC" path="../../../../bin/"/>
<Reference name="Nini" path="../../../../bin/"/>
<Reference name="log4net" path="../../../../bin/"/>