Avoid a possible race condition where the XEngine script compile thread could complete but see OnRezScript() insert a new job and complete before it set m_CurrentCompile = null
If the above happened, it would mean the new script would not compile until some script was added for compilation.mb-throttle-test
parent
76722d8324
commit
227d2e2b61
|
@ -1101,7 +1101,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
// due to a race condition
|
// due to a race condition
|
||||||
//
|
//
|
||||||
lock (m_CompileQueue)
|
lock (m_CompileQueue)
|
||||||
|
{
|
||||||
m_CurrentCompile = null;
|
m_CurrentCompile = null;
|
||||||
|
|
||||||
|
// This is to avoid a situation where the m_CompileQueue while loop above could complete but
|
||||||
|
// OnRezScript() place a new script on the queue and check m_CurrentCompile = null before we hit
|
||||||
|
// this section.
|
||||||
|
if (m_CompileQueue.Count > 0)
|
||||||
|
m_CurrentCompile = m_ThreadPool.QueueWorkItem(DoOnRezScriptQueue, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue