aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-06-13 18:39:42 +0100
committerUbitUmarov2017-06-13 18:39:42 +0100
commit5ce15566acf41be0d07e67e858d22eb65177816a (patch)
tree7b1ccd75ad0c41f079eeaa925b3b4b964dd446ad /OpenSim/Framework/Util.cs
parent hope gc does remove a little dic and contents (diff)
downloadopensim-SC_OLD-5ce15566acf41be0d07e67e858d22eb65177816a.zip
opensim-SC_OLD-5ce15566acf41be0d07e67e858d22eb65177816a.tar.gz
opensim-SC_OLD-5ce15566acf41be0d07e67e858d22eb65177816a.tar.bz2
opensim-SC_OLD-5ce15566acf41be0d07e67e858d22eb65177816a.tar.xz
add option for Fireandforget not timeout (our access to main smartThreadPool)
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index f52a84c..9a1e348 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -2492,8 +2492,9 @@ namespace OpenSim.Framework
2492 public bool Running { get; set; } 2492 public bool Running { get; set; }
2493 public bool Aborted { get; set; } 2493 public bool Aborted { get; set; }
2494 private int started; 2494 private int started;
2495 public bool DoTimeout;
2495 2496
2496 public ThreadInfo(long threadFuncNum, string context) 2497 public ThreadInfo(long threadFuncNum, string context, bool dotimeout = true)
2497 { 2498 {
2498 ThreadFuncNum = threadFuncNum; 2499 ThreadFuncNum = threadFuncNum;
2499 this.context = context; 2500 this.context = context;
@@ -2501,6 +2502,7 @@ namespace OpenSim.Framework
2501 Thread = null; 2502 Thread = null;
2502 Running = false; 2503 Running = false;
2503 Aborted = false; 2504 Aborted = false;
2505 DoTimeout = dotimeout;
2504 } 2506 }
2505 2507
2506 public void Started() 2508 public void Started()
@@ -2571,7 +2573,7 @@ namespace OpenSim.Framework
2571 foreach (KeyValuePair<long, ThreadInfo> entry in activeThreads) 2573 foreach (KeyValuePair<long, ThreadInfo> entry in activeThreads)
2572 { 2574 {
2573 ThreadInfo t = entry.Value; 2575 ThreadInfo t = entry.Value;
2574 if (t.Running && !t.Aborted && (t.Elapsed() >= THREAD_TIMEOUT)) 2576 if (t.DoTimeout && t.Running && !t.Aborted && (t.Elapsed() >= THREAD_TIMEOUT))
2575 { 2577 {
2576 m_log.WarnFormat("Timeout in threadfunc {0} ({1}) {2}", t.ThreadFuncNum, t.Thread.Name, t.GetStackTrace()); 2578 m_log.WarnFormat("Timeout in threadfunc {0} ({1}) {2}", t.ThreadFuncNum, t.Thread.Name, t.GetStackTrace());
2577 t.Abort(); 2579 t.Abort();
@@ -2612,7 +2614,7 @@ namespace OpenSim.Framework
2612 FireAndForget(callback, obj, null); 2614 FireAndForget(callback, obj, null);
2613 } 2615 }
2614 2616
2615 public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context) 2617 public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true)
2616 { 2618 {
2617 Interlocked.Increment(ref numTotalThreadFuncsCalled); 2619 Interlocked.Increment(ref numTotalThreadFuncsCalled);
2618 2620
@@ -2634,7 +2636,7 @@ namespace OpenSim.Framework
2634 bool loggingEnabled = LogThreadPool > 0; 2636 bool loggingEnabled = LogThreadPool > 0;
2635 2637
2636 long threadFuncNum = Interlocked.Increment(ref nextThreadFuncNum); 2638 long threadFuncNum = Interlocked.Increment(ref nextThreadFuncNum);
2637 ThreadInfo threadInfo = new ThreadInfo(threadFuncNum, context); 2639 ThreadInfo threadInfo = new ThreadInfo(threadFuncNum, context, dotimeout);
2638 2640
2639 if (FireAndForgetMethod == FireAndForgetMethod.RegressionTest) 2641 if (FireAndForgetMethod == FireAndForgetMethod.RegressionTest)
2640 { 2642 {