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
parent
969d5f742c
commit
822574df9f
|
@ -2617,7 +2617,7 @@ namespace OpenSim.Framework
|
||||||
public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true)
|
public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true)
|
||||||
{
|
{
|
||||||
Interlocked.Increment(ref numTotalThreadFuncsCalled);
|
Interlocked.Increment(ref numTotalThreadFuncsCalled);
|
||||||
|
/*
|
||||||
if (context != null)
|
if (context != null)
|
||||||
{
|
{
|
||||||
if (!m_fireAndForgetCallsMade.ContainsKey(context))
|
if (!m_fireAndForgetCallsMade.ContainsKey(context))
|
||||||
|
@ -2630,7 +2630,7 @@ namespace OpenSim.Framework
|
||||||
else
|
else
|
||||||
m_fireAndForgetCallsInProgress[context]++;
|
m_fireAndForgetCallsInProgress[context]++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
WaitCallback realCallback;
|
WaitCallback realCallback;
|
||||||
|
|
||||||
bool loggingEnabled = LogThreadPool > 0;
|
bool loggingEnabled = LogThreadPool > 0;
|
||||||
|
@ -2647,8 +2647,8 @@ namespace OpenSim.Framework
|
||||||
Culture.SetCurrentCulture();
|
Culture.SetCurrentCulture();
|
||||||
callback(o);
|
callback(o);
|
||||||
|
|
||||||
if (context != null)
|
// if (context != null)
|
||||||
m_fireAndForgetCallsInProgress[context]--;
|
// m_fireAndForgetCallsInProgress[context]--;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2688,8 +2688,8 @@ namespace OpenSim.Framework
|
||||||
if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread)
|
if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread)
|
||||||
m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed()));
|
m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed()));
|
||||||
|
|
||||||
if (context != null)
|
// if (context != null)
|
||||||
m_fireAndForgetCallsInProgress[context]--;
|
// m_fireAndForgetCallsInProgress[context]--;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2967,7 +2967,8 @@ namespace OpenSim.Framework
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Int32 EnvironmentTickCount()
|
public static Int32 EnvironmentTickCount()
|
||||||
{
|
{
|
||||||
return Environment.TickCount & EnvironmentTickCountMask;
|
double now = GetTimeStampMS();
|
||||||
|
return (int)now;
|
||||||
}
|
}
|
||||||
const Int32 EnvironmentTickCountMask = 0x3fffffff;
|
const Int32 EnvironmentTickCountMask = 0x3fffffff;
|
||||||
|
|
||||||
|
@ -2993,7 +2994,8 @@ namespace OpenSim.Framework
|
||||||
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
|
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
|
||||||
public static Int32 EnvironmentTickCountSubtract(Int32 prevValue)
|
public static Int32 EnvironmentTickCountSubtract(Int32 prevValue)
|
||||||
{
|
{
|
||||||
return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue);
|
double now = GetTimeStampMS();
|
||||||
|
return EnvironmentTickCountSubtract((int)now, prevValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount
|
// Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount
|
||||||
|
|
Loading…
Reference in New Issue