fix race condition
This commit is contained in:
@@ -33,12 +33,18 @@ static uint64_t g_iStartTime = ArchHooks::GetMicrosecondsSinceStart( true );
|
||||
|
||||
static uint64_t GetTime( bool bAccurate )
|
||||
{
|
||||
return ArchHooks::GetMicrosecondsSinceStart( true );
|
||||
|
||||
/* This isn't threadsafe, and locking it would undo any benefit of not
|
||||
* calling GetMicrosecondsSinceStart. */
|
||||
#if 0
|
||||
// if !bAccurate, then don't call ArchHooks to find the current time. Just return the
|
||||
// last calculated time. GetMicrosecondsSinceStart is slow on some archs.
|
||||
static uint64_t usecs = 0;
|
||||
if( bAccurate )
|
||||
usecs = ArchHooks::GetMicrosecondsSinceStart( true );
|
||||
return usecs;
|
||||
#endif
|
||||
}
|
||||
|
||||
float RageTimer::GetTimeSinceStart( bool bAccurate )
|
||||
|
||||
Reference in New Issue
Block a user