mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
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.)
This commit is contained in:
@@ -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 ); }
|
||||
|
||||
Reference in New Issue
Block a user