diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Util.cs | 18 |
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 |