From 00b1b7af74fd59aaf13cee3b21a5340af23ffe1f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 1 Nov 2006 05:42:15 +0000 Subject: [PATCH] simplify --- stepmania/src/RageThreads.cpp | 18 ++++-------------- stepmania/src/RageThreads.h | 6 +++--- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/stepmania/src/RageThreads.cpp b/stepmania/src/RageThreads.cpp index f765d4b6b2..e2ec86c6e3 100644 --- a/stepmania/src/RageThreads.cpp +++ b/stepmania/src/RageThreads.cpp @@ -214,6 +214,7 @@ static ThreadSlot *GetUnknownThreadSlot() RageThread::RageThread() { m_pSlot = NULL; + m_sName = "unnamed"; } RageThread::~RageThread() @@ -244,22 +245,11 @@ void RageThread::Create( int (*fn)(void *), void *data ) int slotno = FindEmptyThreadSlot(); m_pSlot = &g_ThreadSlots[slotno]; - if( name == "" ) - { - 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() ); - } + strcpy( m_pSlot->m_szName, m_sName.c_str() ); if( LOG ) - LOG->Trace( "Starting thread: %s", name.c_str() ); - sprintf( m_pSlot->m_szThreadFormattedOutput, "Thread: %s", name.c_str() ); + LOG->Trace( "Starting thread: %s", m_sName.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, * to make sure it's set before the thread actually starts. (Otherwise, early diff --git a/stepmania/src/RageThreads.h b/stepmania/src/RageThreads.h index aba9dce569..2be17328c7 100644 --- a/stepmania/src/RageThreads.h +++ b/stepmania/src/RageThreads.h @@ -11,8 +11,8 @@ public: RageThread(); ~RageThread(); - void SetName( const RString &n ) { name = n; } - RString GetName() const { return name; } + void SetName( const RString &n ) { m_sName = n; } + RString GetName() const { return m_sName; } void Create( int (*fn)(void *), void *data ); /* For crash handlers: kill or suspend all threads (except for @@ -41,7 +41,7 @@ public: private: ThreadSlot *m_pSlot; - RString name; + RString m_sName; static bool s_bSystemSupportsTLS; static bool s_bIsShowingDialog;