mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
possible multithreading issues
This commit is contained in:
@@ -141,10 +141,9 @@ namespace OpenSim.Framework
|
||||
if (!m_isRunning)
|
||||
return false;
|
||||
|
||||
m_jobQueue?.Add(o);
|
||||
|
||||
lock (m_mainLock)
|
||||
{
|
||||
m_jobQueue?.Add(o);
|
||||
if (m_numberThreads < m_concurrency && m_numberThreads < m_jobQueue.Count)
|
||||
{
|
||||
Util.FireAndForget(ProcessRequests, null, m_name, false);
|
||||
@@ -162,7 +161,15 @@ namespace OpenSim.Framework
|
||||
try
|
||||
{
|
||||
if(!m_jobQueue.TryTake(out obj, m_threadsHoldtime, m_cancelSource.Token))
|
||||
break;
|
||||
{
|
||||
lock (m_mainLock)
|
||||
{
|
||||
if (m_jobQueue.Count > 0)
|
||||
continue;
|
||||
--m_numberThreads;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user