diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 0e181ecaca..6f301f9e45 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -29,7 +29,8 @@ static float g_fTimeBeforeSlow, g_fTimeBeforeFast, g_fTimeBetweenSlow, g_fTimeBe InputFilter::InputFilter() { - queuemutex = new RageMutex; + /* XXX: CircBuf? */ + queuemutex = new RageMutex("InputFilter"); memset( m_BeingHeld, 0, sizeof(m_BeingHeld) ); memset( m_BeingForced, 0, sizeof(m_BeingForced) ); memset( m_fSecsHeld, 0, sizeof(m_fSecsHeld) ); diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index cc7b88f568..5279d75508 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -116,7 +116,7 @@ RageFileManager::RageFileManager( CString argv0 ) { ChangeToDirOfExecutable( argv0 ); - g_Mutex = new RageMutex; + g_Mutex = new RageMutex("RageFileManager"); g_Mountpoints = new RageFileDriverMountpoints; LoadedDriver ld; diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 620f02e2f4..5ba0fc1f2f 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -91,7 +91,7 @@ RageLog::RageLog() g_fileLog = new RageFile; g_fileInfo = new RageFile; - g_Mutex = new RageMutex; + g_Mutex = new RageMutex("Log"); m_bLogToDisk = false; m_bInfoToDisk = false; diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index 2c1225bb55..e2e98658b9 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -16,7 +16,8 @@ RageSoundManager *SOUNDMAN = NULL; -RageSoundManager::RageSoundManager(CString drivers) +RageSoundManager::RageSoundManager(CString drivers): + lock("RageSoundManager") { /* needs to be done first */ SOUNDMAN = this; diff --git a/stepmania/src/RageSounds.cpp b/stepmania/src/RageSounds.cpp index 889e3e52c1..8019c5b2ce 100644 --- a/stepmania/src/RageSounds.cpp +++ b/stepmania/src/RageSounds.cpp @@ -281,7 +281,7 @@ RageSounds::RageSounds() /* Init RageSoundMan first: */ ASSERT( SOUNDMAN ); - g_Mutex = new RageMutex; + g_Mutex = new RageMutex("RageSounds"); g_Playing = new MusicPlaying( new RageSound ); g_UpdatingTimer = false; diff --git a/stepmania/src/RageThreads.cpp b/stepmania/src/RageThreads.cpp index bfe9a1e851..dbee4ea351 100644 --- a/stepmania/src/RageThreads.cpp +++ b/stepmania/src/RageThreads.cpp @@ -134,7 +134,7 @@ const char *ThreadSlot::GetFormattedCheckpoint( int lineno ) } static ThreadSlot g_ThreadSlots[MAX_THREADS]; -static RageMutex g_ThreadSlotsLock; +static RageMutex g_ThreadSlotsLock("ThreadSlots"); static int FindEmptyThreadSlot() { @@ -737,7 +737,8 @@ void RageMutexImpl::Unlock() -RageMutex::RageMutex() +RageMutex::RageMutex( const CString name ): + m_sName( name ) { mut = new RageMutexImpl; } diff --git a/stepmania/src/RageThreads.h b/stepmania/src/RageThreads.h index 3e9b48c6c3..5a59bf0ec1 100644 --- a/stepmania/src/RageThreads.h +++ b/stepmania/src/RageThreads.h @@ -47,11 +47,12 @@ struct RageMutexImpl; class RageMutex { RageMutexImpl *mut; + const CString m_sName; public: void Lock(); void Unlock(); - RageMutex(); + RageMutex( CString name ); ~RageMutex(); }; diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp index 55fedbaf69..aec645e2a0 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -16,7 +16,7 @@ ArchHooks_Win32::ArchHooks_Win32() { SetUnhandledExceptionFilter(CrashHandler); - TimeCritMutex = new RageMutex; + TimeCritMutex = new RageMutex("TimeCritMutex"); } ArchHooks_Win32::~ArchHooks_Win32() diff --git a/stepmania/src/archutils/Win32/arch_setup.cpp b/stepmania/src/archutils/Win32/arch_setup.cpp index ac526c0ab7..a323529f77 100644 --- a/stepmania/src/archutils/Win32/arch_setup.cpp +++ b/stepmania/src/archutils/Win32/arch_setup.cpp @@ -5,7 +5,7 @@ struct tm *my_localtime_r( const time_t *timep, struct tm *result ) { - static RageMutex mut; + static RageMutex mut("my_localtime_r"); LockMut(mut); *result = *localtime( timep ); @@ -14,7 +14,7 @@ struct tm *my_localtime_r( const time_t *timep, struct tm *result ) struct tm *my_gmtime_r( const time_t *timep, struct tm *result ) { - static RageMutex mut; + static RageMutex mut("my_gmtime_r"); LockMut(mut); *result = *gmtime( timep );