From e1aa591815f451f4fcf7eb49065d8e300141d9bf Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 23 May 2017 05:59:14 +0100 Subject: allow new thread creation if it was aborted on AsyncCommandManager --- .../Shared/Api/Implementation/AsyncCommandManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index cefd39e..4714275 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs @@ -182,9 +182,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (cmdHandlerThread == null) { // Start the thread that will be doing the work - cmdHandlerThread - = WorkManager.StartThread( + lock (staticLock) + { + cmdHandlerThread = WorkManager.StartThread( CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true); + } } } @@ -210,7 +212,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (cmdHandlerThread.IsAlive == true) { cmdHandlerThread.Abort(); - //cmdHandlerThread.Join(); + //cmdHandlerThread.Join(); + cmdHandlerThread = null; } } } -- cgit v1.1