aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-08-30 08:56:35 +0100
committerUbitUmarov2016-08-30 08:56:35 +0100
commit4e1784d0698b975e63ea713d7b0f8fdd9f9ef18d (patch)
tree428ee404721dec49acd05e20b5be96404d9c0030 /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
parentmantis 8013: change attachment group to active group on attach from inventory (diff)
downloadopensim-SC-4e1784d0698b975e63ea713d7b0f8fdd9f9ef18d.zip
opensim-SC-4e1784d0698b975e63ea713d7b0f8fdd9f9ef18d.tar.gz
opensim-SC-4e1784d0698b975e63ea713d7b0f8fdd9f9ef18d.tar.bz2
opensim-SC-4e1784d0698b975e63ea713d7b0f8fdd9f9ef18d.tar.xz
Xengine: remove a no thread safe locking, don't allocate a few objects only needed if creating a new domain
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rwxr-xr-xOpenSim/Region/ScriptEngine/XEngine/XEngine.cs37
1 files changed, 16 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 78d4ee9..ecd0b69 100755
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1024,18 +1024,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1024 1024
1025// m_log.DebugFormat("[XEngine]: Added script {0} to compile queue", itemID); 1025// m_log.DebugFormat("[XEngine]: Added script {0} to compile queue", itemID);
1026 1026
1027 if (m_CurrentCompile == null) 1027 // NOTE: Although we use a lockless queue, the lock here
1028 // is required. It ensures that there are never two
1029 // compile threads running, which, due to a race
1030 // conndition, might otherwise happen
1031 //
1032 lock (m_CompileQueue)
1028 { 1033 {
1029 // NOTE: Although we use a lockless queue, the lock here 1034 if (m_CurrentCompile == null)
1030 // is required. It ensures that there are never two 1035 m_CurrentCompile = m_ThreadPool.QueueWorkItem(DoOnRezScriptQueue, null);
1031 // compile threads running, which, due to a race
1032 // conndition, might otherwise happen
1033 //
1034 lock (m_CompileQueue)
1035 {
1036 if (m_CurrentCompile == null)
1037 m_CurrentCompile = m_ThreadPool.QueueWorkItem(DoOnRezScriptQueue, null);
1038 }
1039 } 1036 }
1040 } 1037 }
1041 } 1038 }
@@ -1297,17 +1294,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1297 { 1294 {
1298 try 1295 try
1299 { 1296 {
1300 AppDomainSetup appSetup = new AppDomainSetup(); 1297 AppDomain sandbox;
1301 appSetup.PrivateBinPath = Path.Combine( 1298 if (m_AppDomainLoading)
1299 {
1300 AppDomainSetup appSetup = new AppDomainSetup();
1301 appSetup.PrivateBinPath = Path.Combine(
1302 m_ScriptEnginesPath, 1302 m_ScriptEnginesPath,
1303 m_Scene.RegionInfo.RegionID.ToString()); 1303 m_Scene.RegionInfo.RegionID.ToString());
1304 1304
1305 Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; 1305 Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
1306 Evidence evidence = new Evidence(baseEvidence); 1306 Evidence evidence = new Evidence(baseEvidence);
1307 1307
1308 AppDomain sandbox;
1309 if (m_AppDomainLoading)
1310 {
1311 sandbox = AppDomain.CreateDomain( 1308 sandbox = AppDomain.CreateDomain(
1312 m_Scene.RegionInfo.RegionID.ToString(), 1309 m_Scene.RegionInfo.RegionID.ToString(),
1313 evidence, appSetup); 1310 evidence, appSetup);
@@ -1472,9 +1469,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1472 startParam, postOnRez, 1469 startParam, postOnRez,
1473 m_MaxScriptQueue); 1470 m_MaxScriptQueue);
1474 1471
1475 if ( 1472 if(!instance.Load(scriptObj, coopSleepHandle, assemblyPath,
1476 !instance.Load(
1477 scriptObj, coopSleepHandle, assemblyPath,
1478 Path.Combine(ScriptEnginePath, World.RegionInfo.RegionID.ToString()), stateSource, coopTerminationForThisScript)) 1473 Path.Combine(ScriptEnginePath, World.RegionInfo.RegionID.ToString()), stateSource, coopTerminationForThisScript))
1479 return false; 1474 return false;
1480 1475