aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2017-06-15 20:28:20 +0100
committerUbitUmarov2017-06-15 20:28:20 +0100
commit822574df9f3889c877035d302f9060769ed27e70 (patch)
tree07896a5a18f048361e6ff5a424d8353e0d7c8e9f
parent update inventory item permissions on deattach (diff)
downloadopensim-SC-822574df9f3889c877035d302f9060769ed27e70.zip
opensim-SC-822574df9f3889c877035d302f9060769ed27e70.tar.gz
opensim-SC-822574df9f3889c877035d302f9060769ed27e70.tar.bz2
opensim-SC-822574df9f3889c877035d302f9060769ed27e70.tar.xz
change the clock source for EnvironmentTickCount so it does get a bit more resolution if avaiable (1ms) specially on windows. This until all calls to this are removed. Coment out some stats in workpool/threads creation path
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs18
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 9a1e348..a855767 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -2617,7 +2617,7 @@ namespace OpenSim.Framework
2617 public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true) 2617 public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true)
2618 { 2618 {
2619 Interlocked.Increment(ref numTotalThreadFuncsCalled); 2619 Interlocked.Increment(ref numTotalThreadFuncsCalled);
2620 2620/*
2621 if (context != null) 2621 if (context != null)
2622 { 2622 {
2623 if (!m_fireAndForgetCallsMade.ContainsKey(context)) 2623 if (!m_fireAndForgetCallsMade.ContainsKey(context))
@@ -2630,7 +2630,7 @@ namespace OpenSim.Framework
2630 else 2630 else
2631 m_fireAndForgetCallsInProgress[context]++; 2631 m_fireAndForgetCallsInProgress[context]++;
2632 } 2632 }
2633 2633*/
2634 WaitCallback realCallback; 2634 WaitCallback realCallback;
2635 2635
2636 bool loggingEnabled = LogThreadPool > 0; 2636 bool loggingEnabled = LogThreadPool > 0;
@@ -2647,8 +2647,8 @@ namespace OpenSim.Framework
2647 Culture.SetCurrentCulture(); 2647 Culture.SetCurrentCulture();
2648 callback(o); 2648 callback(o);
2649 2649
2650 if (context != null) 2650// if (context != null)
2651 m_fireAndForgetCallsInProgress[context]--; 2651// m_fireAndForgetCallsInProgress[context]--;
2652 }; 2652 };
2653 } 2653 }
2654 else 2654 else
@@ -2688,8 +2688,8 @@ namespace OpenSim.Framework
2688 if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread) 2688 if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread)
2689 m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed())); 2689 m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed()));
2690 2690
2691 if (context != null) 2691// if (context != null)
2692 m_fireAndForgetCallsInProgress[context]--; 2692// m_fireAndForgetCallsInProgress[context]--;
2693 } 2693 }
2694 }; 2694 };
2695 } 2695 }
@@ -2967,7 +2967,8 @@ namespace OpenSim.Framework
2967 /// <returns></returns> 2967 /// <returns></returns>
2968 public static Int32 EnvironmentTickCount() 2968 public static Int32 EnvironmentTickCount()
2969 { 2969 {
2970 return Environment.TickCount & EnvironmentTickCountMask; 2970 double now = GetTimeStampMS();
2971 return (int)now;
2971 } 2972 }
2972 const Int32 EnvironmentTickCountMask = 0x3fffffff; 2973 const Int32 EnvironmentTickCountMask = 0x3fffffff;
2973 2974
@@ -2993,7 +2994,8 @@ namespace OpenSim.Framework
2993 /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> 2994 /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
2994 public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) 2995 public static Int32 EnvironmentTickCountSubtract(Int32 prevValue)
2995 { 2996 {
2996 return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue); 2997 double now = GetTimeStampMS();
2998 return EnvironmentTickCountSubtract((int)now, prevValue);
2997 } 2999 }
2998 3000
2999 // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount 3001 // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount