diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rwxr-xr-x[-rw-r--r--] | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 54620d1..4e383f8 100644..100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1872,6 +1872,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1872 | IScriptInstance instance = GetInstance(itemID); | 1872 | IScriptInstance instance = GetInstance(itemID); |
1873 | if (instance != null) | 1873 | if (instance != null) |
1874 | instance.ApiResetScript(); | 1874 | instance.ApiResetScript(); |
1875 | |||
1876 | // Send the new number of threads that are in use by the thread | ||
1877 | // pool, I believe that by adding them to the locations where the | ||
1878 | // script is changing states that I will catch all changes to the | ||
1879 | // thread pool | ||
1880 | m_Scene.setThreadCount(m_ThreadPool.InUseThreads); | ||
1875 | } | 1881 | } |
1876 | 1882 | ||
1877 | public void ResetScript(UUID itemID) | 1883 | public void ResetScript(UUID itemID) |
@@ -1879,6 +1885,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1879 | IScriptInstance instance = GetInstance(itemID); | 1885 | IScriptInstance instance = GetInstance(itemID); |
1880 | if (instance != null) | 1886 | if (instance != null) |
1881 | instance.ResetScript(m_WaitForEventCompletionOnScriptStop); | 1887 | instance.ResetScript(m_WaitForEventCompletionOnScriptStop); |
1888 | |||
1889 | // Send the new number of threads that are in use by the thread | ||
1890 | // pool, I believe that by adding them to the locations where the | ||
1891 | // script is changing states that I will catch all changes to the | ||
1892 | // thread pool | ||
1893 | m_Scene.setThreadCount(m_ThreadPool.InUseThreads); | ||
1882 | } | 1894 | } |
1883 | 1895 | ||
1884 | public void StartScript(UUID itemID) | 1896 | public void StartScript(UUID itemID) |
@@ -1888,6 +1900,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1888 | instance.Start(); | 1900 | instance.Start(); |
1889 | else | 1901 | else |
1890 | m_runFlags.AddOrUpdate(itemID, true, 240); | 1902 | m_runFlags.AddOrUpdate(itemID, true, 240); |
1903 | |||
1904 | // Send the new number of threads that are in use by the thread | ||
1905 | // pool, I believe that by adding them to the locations where the | ||
1906 | // script is changing states that I will catch all changes to the | ||
1907 | // thread pool | ||
1908 | m_Scene.setThreadCount(m_ThreadPool.InUseThreads); | ||
1891 | } | 1909 | } |
1892 | 1910 | ||
1893 | public void StopScript(UUID itemID) | 1911 | public void StopScript(UUID itemID) |
@@ -1903,6 +1921,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1903 | // m_log.DebugFormat("[XENGINE]: Could not find script with ID {0} to stop in {1}", itemID, World.Name); | 1921 | // m_log.DebugFormat("[XENGINE]: Could not find script with ID {0} to stop in {1}", itemID, World.Name); |
1904 | m_runFlags.AddOrUpdate(itemID, false, 240); | 1922 | m_runFlags.AddOrUpdate(itemID, false, 240); |
1905 | } | 1923 | } |
1924 | |||
1925 | // Send the new number of threads that are in use by the thread | ||
1926 | // pool, I believe that by adding them to the locations where the | ||
1927 | // script is changing states that I will catch all changes to the | ||
1928 | // thread pool | ||
1929 | m_Scene.setThreadCount(m_ThreadPool.InUseThreads); | ||
1906 | } | 1930 | } |
1907 | 1931 | ||
1908 | public DetectParams GetDetectParams(UUID itemID, int idx) | 1932 | public DetectParams GetDetectParams(UUID itemID, int idx) |
@@ -2393,6 +2417,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2393 | instance.Suspend(); | 2417 | instance.Suspend(); |
2394 | // else | 2418 | // else |
2395 | // m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID); | 2419 | // m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID); |
2420 | |||
2421 | // Send the new number of threads that are in use by the thread | ||
2422 | // pool, I believe that by adding them to the locations where the | ||
2423 | // script is changing states that I will catch all changes to the | ||
2424 | // thread pool | ||
2425 | m_Scene.setThreadCount(m_ThreadPool.InUseThreads); | ||
2396 | } | 2426 | } |
2397 | 2427 | ||
2398 | public void ResumeScript(UUID itemID) | 2428 | public void ResumeScript(UUID itemID) |
@@ -2404,6 +2434,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2404 | instance.Resume(); | 2434 | instance.Resume(); |
2405 | // else | 2435 | // else |
2406 | // m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID); | 2436 | // m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID); |
2437 | |||
2438 | // Send the new number of threads that are in use by the thread | ||
2439 | // pool, I believe that by adding them to the locations where the | ||
2440 | // script is changing states that I will catch all changes to the | ||
2441 | // thread pool | ||
2442 | m_Scene.setThreadCount(m_ThreadPool.InUseThreads); | ||
2407 | } | 2443 | } |
2408 | 2444 | ||
2409 | public bool HasScript(UUID itemID, out bool running) | 2445 | public bool HasScript(UUID itemID, out bool running) |