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 )
|
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
|
// if !bAccurate, then don't call ArchHooks to find the current time. Just return the
|
||||||
// last calculated time. GetMicrosecondsSinceStart is slow on some archs.
|
// last calculated time. GetMicrosecondsSinceStart is slow on some archs.
|
||||||
static uint64_t usecs = 0;
|
static uint64_t usecs = 0;
|
||||||
if( bAccurate )
|
if( bAccurate )
|
||||||
usecs = ArchHooks::GetMicrosecondsSinceStart( true );
|
usecs = ArchHooks::GetMicrosecondsSinceStart( true );
|
||||||
return usecs;
|
return usecs;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
float RageTimer::GetTimeSinceStart( bool bAccurate )
|
float RageTimer::GetTimeSinceStart( bool bAccurate )
|
||||||
|
|||||||
Reference in New Issue
Block a user