From fd0c16985826ecbca3f7363e34f56b1d552fa4ac Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 7 Feb 2006 08:43:25 +0000 Subject: [PATCH] fix race condition --- stepmania/src/RageTimer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/src/RageTimer.cpp b/stepmania/src/RageTimer.cpp index dc907a1f4d..e3719f47f9 100644 --- a/stepmania/src/RageTimer.cpp +++ b/stepmania/src/RageTimer.cpp @@ -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 )