useless changes

master
UbitUmarov 2020-07-15 05:15:32 +01:00
parent 6c5bf4ed25
commit 6a27f3fb20
2 changed files with 10 additions and 8 deletions

View File

@ -3058,10 +3058,12 @@ namespace OpenSim.Framework
{ {
Interlocked.Decrement(ref numRunningThreadFuncs); Interlocked.Decrement(ref numRunningThreadFuncs);
threadInfo.Ended(); threadInfo.Ended();
ThreadInfo dummy; activeThreads.TryRemove(threadFuncNum, out ThreadInfo dummy);
activeThreads.TryRemove(threadFuncNum, out dummy);
if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread) if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread)
m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed())); m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed()));
callback = null;
o = null;
threadInfo = null;
} }
}; };
} }
@ -3083,10 +3085,10 @@ namespace OpenSim.Framework
case FireAndForgetMethod.SmartThreadPool: case FireAndForgetMethod.SmartThreadPool:
if (m_ThreadPool == null) if (m_ThreadPool == null)
InitThreadPool(2, 15); InitThreadPool(2, 15);
threadInfo.WorkItem = m_ThreadPool.QueueWorkItem((cb, o) => cb(o), realCallback, obj); threadInfo.WorkItem = m_ThreadPool.QueueWorkItem((cb, o) => {cb(o); cb = null;}, realCallback, obj);
break; break;
case FireAndForgetMethod.Thread: case FireAndForgetMethod.Thread:
Thread thread = new Thread(delegate(object o) { realCallback(o); }); Thread thread = new Thread(delegate(object o) { realCallback(o); realCallback = null;});
thread.Start(obj); thread.Start(obj);
break; break;
default: default:
@ -3096,8 +3098,7 @@ namespace OpenSim.Framework
catch (Exception) catch (Exception)
{ {
Interlocked.Decrement(ref numQueuedThreadFuncs); Interlocked.Decrement(ref numQueuedThreadFuncs);
ThreadInfo dummy; activeThreads.TryRemove(threadFuncNum, out ThreadInfo dummy);
activeThreads.TryRemove(threadFuncNum, out dummy);
throw; throw;
} }
} }

View File

@ -249,7 +249,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
public AssetMetadata GetMetadata(string id) public AssetMetadata GetMetadata(string id)
{ {
AssetBase asset = null; AssetBase asset = null;
if (m_Cache != null) if (m_Cache != null)
{ {
if (!m_Cache.Get(id, out asset)) if (!m_Cache.Get(id, out asset))
@ -301,7 +300,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
if (asset != null) if (asset != null)
{ {
Util.FireAndForget(delegate { handler(id, sender, asset); }, null, "HGAssetBroker.GotFromCache"); Util.FireAndForget(delegate { handler(id, sender, asset); asset = null; }, null, "HGAssetBroker.GotFromCache");
return true; return true;
} }
@ -312,6 +311,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
if (m_Cache != null) if (m_Cache != null)
m_Cache.Cache(a); m_Cache.Cache(a);
handler(assetID, s, a); handler(assetID, s, a);
a = null;
}); });
} }
else else
@ -321,6 +321,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
if (m_Cache != null) if (m_Cache != null)
m_Cache.Cache(a); m_Cache.Cache(a);
handler(assetID, s, a); handler(assetID, s, a);
a = null;
}); });
} }
} }