From 435ec1818a38334cd230a101dd6395fd4cd26cc5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 19 Dec 2006 08:03:42 +0000 Subject: [PATCH] remove EnterTimeCriticalSection/ExitTimeCriticalSection --- stepmania/src/arch/ArchHooks/ArchHooks.h | 8 -------- .../src/arch/ArchHooks/ArchHooks_Win32.cpp | 19 ------------------- .../src/arch/ArchHooks/ArchHooks_Win32.h | 4 ---- 3 files changed, 31 deletions(-) diff --git a/stepmania/src/arch/ArchHooks/ArchHooks.h b/stepmania/src/arch/ArchHooks/ArchHooks.h index 1d75104ee0..4140aa08d8 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks.h +++ b/stepmania/src/arch/ArchHooks/ArchHooks.h @@ -38,14 +38,6 @@ public: */ virtual bool CheckForMultipleInstances() { return false; } - /* - * Call this to temporarily enter a high-priority or realtime scheduling (depending - * on the implementation) mode. This is used to improve timestamp accuracy. Do as - * little as possible in this mode; hanging in it might hang the system entirely. - */ - virtual void EnterTimeCriticalSection() { } - virtual void ExitTimeCriticalSection() { } - virtual void SetTime( tm newtime ) { } virtual void BoostPriority() { } diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp index b14a296679..e072d22b9d 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -17,7 +17,6 @@ static bool g_bIsMultipleInstance = false; ArchHooks_Win32::ArchHooks_Win32() { - TimeCritMutex = NULL; HOOKS = this; /* Disable critical errors, and handle them internally. We never want the @@ -27,8 +26,6 @@ ArchHooks_Win32::ArchHooks_Win32() CrashHandler::CrashHandlerHandleArgs( g_argc, g_argv ); SetUnhandledExceptionFilter( CrashHandler::ExceptionHandler ); - TimeCritMutex = new RageMutex("TimeCritMutex"); - /* Windows boosts priority on keyboard input, among other things. Disable that for * the main thread. */ SetThreadPriorityBoost( GetCurrentThread(), TRUE ); @@ -43,7 +40,6 @@ ArchHooks_Win32::ArchHooks_Win32() ArchHooks_Win32::~ArchHooks_Win32() { CloseHandle( g_hInstanceMutex ); - delete TimeCritMutex; } void ArchHooks_Win32::DumpDebugInfo() @@ -119,21 +115,6 @@ void ArchHooks_Win32::RestartProgram() Win32RestartProgram(); } -void ArchHooks_Win32::EnterTimeCriticalSection() -{ - TimeCritMutex->Lock(); - - OldThreadPriority = GetThreadPriority( GetCurrentThread() ); - SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL ); -} - -void ArchHooks_Win32::ExitTimeCriticalSection() -{ - SetThreadPriority( GetCurrentThread(), OldThreadPriority ); - OldThreadPriority = 0; - TimeCritMutex->Unlock(); -} - void ArchHooks_Win32::SetTime( tm newtime ) { SYSTEMTIME st; diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h index 1a84a5c546..77a32405ff 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.h @@ -15,10 +15,6 @@ public: RString GetMachineId() const; bool CheckForMultipleInstances(); - int OldThreadPriority; - RageMutex *TimeCritMutex; - void EnterTimeCriticalSection(); - void ExitTimeCriticalSection(); void SetTime( tm newtime ); void BoostPriority();