remove EnterTimeCriticalSection/ExitTimeCriticalSection
This commit is contained in:
@@ -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() { }
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -15,10 +15,6 @@ public:
|
||||
RString GetMachineId() const;
|
||||
bool CheckForMultipleInstances();
|
||||
|
||||
int OldThreadPriority;
|
||||
RageMutex *TimeCritMutex;
|
||||
void EnterTimeCriticalSection();
|
||||
void ExitTimeCriticalSection();
|
||||
void SetTime( tm newtime );
|
||||
|
||||
void BoostPriority();
|
||||
|
||||
Reference in New Issue
Block a user