diff options
author | Tedd Hansen | 2008-02-21 23:43:58 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-21 23:43:58 +0000 |
commit | f75e418211fa072b03515e19f770ee20ba9a80d6 (patch) | |
tree | 22a2338ad41f65fcd563ef9a59daa628469aa46f /OpenSim | |
parent | * Fixed an issue where the client thread was aborted before the UDP server se... (diff) | |
download | opensim-SC-f75e418211fa072b03515e19f770ee20ba9a80d6.zip opensim-SC-f75e418211fa072b03515e19f770ee20ba9a80d6.tar.gz opensim-SC-f75e418211fa072b03515e19f770ee20ba9a80d6.tar.bz2 opensim-SC-f75e418211fa072b03515e19f770ee20ba9a80d6.tar.xz |
Fixes to ScriptEngine thread cleanup on destructor
Diffstat (limited to 'OpenSim')
4 files changed, 14 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs index 81e3438..fbdfff8 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncLSLCommandManager.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
75 | if (cmdHandlerThread.IsAlive == true) | 75 | if (cmdHandlerThread.IsAlive == true) |
76 | { | 76 | { |
77 | cmdHandlerThread.Abort(); | 77 | cmdHandlerThread.Abort(); |
78 | cmdHandlerThread.Join(); | 78 | //cmdHandlerThread.Join(); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index eaffe3f..aa7e3e9 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -233,15 +233,15 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
233 | if (eventQueueThreads != null && eventQueueThreads != null) | 233 | if (eventQueueThreads != null && eventQueueThreads != null) |
234 | { | 234 | { |
235 | // Kill worker threads | 235 | // Kill worker threads |
236 | lock (eventQueueThreads) | 236 | //lock (eventQueueThreads) |
237 | { | 237 | //{ |
238 | foreach (EventQueueThreadClass EventQueueThread in eventQueueThreads) | 238 | foreach (EventQueueThreadClass EventQueueThread in new ArrayList(eventQueueThreads)) |
239 | { | 239 | { |
240 | AbortThreadClass(EventQueueThread); | 240 | AbortThreadClass(EventQueueThread); |
241 | } | 241 | } |
242 | eventQueueThreads.Clear(); | 242 | //eventQueueThreads.Clear(); |
243 | staticGlobalEventQueueThreads.Clear(); | 243 | //staticGlobalEventQueueThreads.Clear(); |
244 | } | 244 | //} |
245 | } | 245 | } |
246 | 246 | ||
247 | // Remove all entries from our event queue | 247 | // Remove all entries from our event queue |
@@ -275,10 +275,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
275 | } | 275 | } |
276 | catch (Exception ex) | 276 | catch (Exception ex) |
277 | { | 277 | { |
278 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + ":EventQueueManager]: If you see this, could you please report it to Tedd:"); | 278 | //m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + ":EventQueueManager]: If you see this, could you please report it to Tedd:"); |
279 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + ":EventQueueManager]: Script thread execution timeout kill ended in exception: " + ex.ToString()); | 279 | //m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + ":EventQueueManager]: Script thread execution timeout kill ended in exception: " + ex.ToString()); |
280 | } | 280 | } |
281 | m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: Killed script execution thread. Remaining thread count: " + eventQueueThreads.Count); | 281 | //m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: Killed script execution thread. Remaining thread count: " + eventQueueThreads.Count); |
282 | } | 282 | } |
283 | #endregion | 283 | #endregion |
284 | 284 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index cf66e7a..11fd896 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs | |||
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
134 | try | 134 | try |
135 | { | 135 | { |
136 | EventQueueThread.Abort(); // Send abort | 136 | EventQueueThread.Abort(); // Send abort |
137 | EventQueueThread.Join(); // Wait for it | 137 | //EventQueueThread.Join(); // Wait for it |
138 | } | 138 | } |
139 | catch (Exception) | 139 | catch (Exception) |
140 | { | 140 | { |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index 4776ffe..f959a5b 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | |||
@@ -88,23 +88,20 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
88 | private void StopMaintenanceThread() | 88 | private void StopMaintenanceThread() |
89 | { | 89 | { |
90 | #if DEBUG | 90 | #if DEBUG |
91 | m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called"); | 91 | //m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called"); |
92 | #endif | 92 | #endif |
93 | PleaseShutdown = true; | 93 | PleaseShutdown = true; |
94 | Thread.Sleep(100); | 94 | Thread.Sleep(100); |
95 | try | 95 | try |
96 | { | 96 | { |
97 | if (MaintenanceThreadThread != null) | 97 | if (MaintenanceThreadThread != null && MaintenanceThreadThread.IsAlive) |
98 | { | ||
99 | if (MaintenanceThreadThread.IsAlive) | ||
100 | { | 98 | { |
101 | MaintenanceThreadThread.Abort(); | 99 | MaintenanceThreadThread.Abort(); |
102 | } | 100 | } |
103 | } | ||
104 | } | 101 | } |
105 | catch (Exception ex) | 102 | catch (Exception ex) |
106 | { | 103 | { |
107 | m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Exception stopping maintenence thread: " + ex.ToString()); | 104 | //m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Exception stopping maintenence thread: " + ex.ToString()); |
108 | } | 105 | } |
109 | } | 106 | } |
110 | 107 | ||