This commit is contained in:
Glenn Maynard
2006-11-01 05:42:15 +00:00
parent b5e66c2712
commit 00b1b7af74
2 changed files with 7 additions and 17 deletions
+4 -14
View File
@@ -214,6 +214,7 @@ static ThreadSlot *GetUnknownThreadSlot()
RageThread::RageThread() RageThread::RageThread()
{ {
m_pSlot = NULL; m_pSlot = NULL;
m_sName = "unnamed";
} }
RageThread::~RageThread() RageThread::~RageThread()
@@ -244,22 +245,11 @@ void RageThread::Create( int (*fn)(void *), void *data )
int slotno = FindEmptyThreadSlot(); int slotno = FindEmptyThreadSlot();
m_pSlot = &g_ThreadSlots[slotno]; m_pSlot = &g_ThreadSlots[slotno];
if( name == "" ) strcpy( m_pSlot->m_szName, m_sName.c_str() );
{
if( LOG )
LOG->Warn( "Created a thread without naming it first." );
/* If you don't name it, I will: */
strcpy( m_pSlot->m_szName, "Joe" );
}
else
{
strcpy( m_pSlot->m_szName, name.c_str() );
}
if( LOG ) if( LOG )
LOG->Trace( "Starting thread: %s", name.c_str() ); LOG->Trace( "Starting thread: %s", m_sName.c_str() );
sprintf( m_pSlot->m_szThreadFormattedOutput, "Thread: %s", name.c_str() ); sprintf( m_pSlot->m_szThreadFormattedOutput, "Thread: %s", m_sName.c_str() );
/* Start a thread using our own startup function. We pass the id to fill in, /* Start a thread using our own startup function. We pass the id to fill in,
* to make sure it's set before the thread actually starts. (Otherwise, early * to make sure it's set before the thread actually starts. (Otherwise, early
+3 -3
View File
@@ -11,8 +11,8 @@ public:
RageThread(); RageThread();
~RageThread(); ~RageThread();
void SetName( const RString &n ) { name = n; } void SetName( const RString &n ) { m_sName = n; }
RString GetName() const { return name; } RString GetName() const { return m_sName; }
void Create( int (*fn)(void *), void *data ); void Create( int (*fn)(void *), void *data );
/* For crash handlers: kill or suspend all threads (except for /* For crash handlers: kill or suspend all threads (except for
@@ -41,7 +41,7 @@ public:
private: private:
ThreadSlot *m_pSlot; ThreadSlot *m_pSlot;
RString name; RString m_sName;
static bool s_bSystemSupportsTLS; static bool s_bSystemSupportsTLS;
static bool s_bIsShowingDialog; static bool s_bIsShowingDialog;