From a649cce9a6e03c00396e90117dbe98f2d6d48427 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 28 Mar 2006 02:06:06 +0000 Subject: [PATCH] Disable the real time critical sections, it's causing audio problems on single processor machines. --- stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp index 6eb5db6004..72c0108dd7 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_darwin.cpp @@ -19,8 +19,12 @@ #include #include +#define REAL_TIME_CRITICAL_SECTION 0 + +#if REAL_TIME_CRITICAL_SECTION static thread_time_constraint_policy g_oldttcpolicy; static float g_fStartedTimeCritAt; +#endif static bool IsFatalSignal( int signal ) { @@ -227,6 +231,7 @@ RString ArchHooks::GetPreferredLanguage() void ArchHooks_darwin::EnterTimeCriticalSection() { +#if REAL_TIME_CRITICAL_SECTION TimeCritMutex->Lock(); mach_msg_type_number_t cnt = THREAD_TIME_CONSTRAINT_POLICY_COUNT; @@ -261,10 +266,12 @@ void ArchHooks_darwin::EnterTimeCriticalSection() LOG->Warn( "thread_policy_set(THREAD_TIME_CONSTRAINT_POLICY): %s", mach_error_string(ret) ); g_fStartedTimeCritAt = RageTimer::GetTimeSinceStart(); +#endif } void ArchHooks_darwin::ExitTimeCriticalSection() { +#if REAL_TIME_CRITICAL_SECTION kern_return_t ret; ret = thread_policy_set( mach_thread_self(), THREAD_TIME_CONSTRAINT_POLICY, @@ -277,6 +284,7 @@ void ArchHooks_darwin::ExitTimeCriticalSection() float fTimeCritLen = RageTimer::GetTimeSinceStart() - g_fStartedTimeCritAt; if( fTimeCritLen > 0.003f ) LOG->Warn( "Time-critical section lasted for %f", fTimeCritLen ); +#endif } int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate )