mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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.
This commit is contained in:
@@ -1101,7 +1101,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
// due to a race condition
|
||||
//
|
||||
lock (m_CompileQueue)
|
||||
{
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user