give RageMutexes names, so they can be identified more easily

This commit is contained in:
Glenn Maynard
2004-03-21 04:10:43 +00:00
parent 527be89140
commit e779e80350
9 changed files with 15 additions and 11 deletions
+2 -1
View File
@@ -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) );
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+2 -1
View File
@@ -16,7 +16,8 @@
RageSoundManager *SOUNDMAN = NULL;
RageSoundManager::RageSoundManager(CString drivers)
RageSoundManager::RageSoundManager(CString drivers):
lock("RageSoundManager")
{
/* needs to be done first */
SOUNDMAN = this;
+1 -1
View File
@@ -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;
+3 -2
View File
@@ -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;
}
+2 -1
View File
@@ -47,11 +47,12 @@ struct RageMutexImpl;
class RageMutex
{
RageMutexImpl *mut;
const CString m_sName;
public:
void Lock();
void Unlock();
RageMutex();
RageMutex( CString name );
~RageMutex();
};
@@ -16,7 +16,7 @@
ArchHooks_Win32::ArchHooks_Win32()
{
SetUnhandledExceptionFilter(CrashHandler);
TimeCritMutex = new RageMutex;
TimeCritMutex = new RageMutex("TimeCritMutex");
}
ArchHooks_Win32::~ArchHooks_Win32()
+2 -2
View File
@@ -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 );