fix race condition

This commit is contained in:
Glenn Maynard
2006-02-07 08:43:25 +00:00
parent d449ca554c
commit fd0c169858
+6
View File
@@ -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 )