Move IThinker::EnsureMinThinkTime out of line

Having it inline was a small speedup, but really not worth the ugly
macros needed to deal with tsan.  (In tsan we need to make sure it
isn't expanded inline in order for the supression to work properly.)

(cherry picked from commit 45c98cc535)
This commit is contained in:
Fletcher Dunn
2026-05-06 19:58:29 -07:00
parent 6ac43fa2eb
commit 4e94f2413f
2 changed files with 8 additions and 6 deletions
@@ -95,6 +95,13 @@ ATTR_NO_SANITIZE_THREAD void IThinker::SetNextThinkTime( SteamNetworkingMicrosec
s_mutexThinkerTable.unlock();
}
ATTR_NO_SANITIZE_THREAD void IThinker::EnsureMinThinkTime( SteamNetworkingMicroseconds usecTargetThinkTime )
{
// Lockless fast-path read -- see SetNextThinkTime for explanation of the intentional race.
if ( usecTargetThinkTime < m_usecNextThinkTime )
InternalEnsureMinThinkTime( usecTargetThinkTime );
}
void IThinker::InternalSetNextThinkTime( SteamNetworkingMicroseconds usecTargetThinkTime )
{
@@ -31,12 +31,7 @@ public:
/// Adjust schedule time to the earlier of the current schedule time,
/// or the given time.
ATTR_NO_SANITIZE_THREAD inline void EnsureMinThinkTime( SteamNetworkingMicroseconds usecTargetThinkTime )
{
// Lockless fast-path read -- see SetNextThinkTime for explanation of the intentional race.
if ( usecTargetThinkTime < m_usecNextThinkTime )
InternalEnsureMinThinkTime( usecTargetThinkTime );
}
void EnsureMinThinkTime( SteamNetworkingMicroseconds usecTargetThinkTime );
/// Clear the next think time. You won't get a callback.
void ClearNextThinkTime() { SetNextThinkTime( k_nThinkTime_Never ); }