From 17a5f6643863dea725edde28cf17e6e609228819 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 19 Dec 2005 02:08:06 +0000 Subject: [PATCH] remove CreateThisThread --- stepmania/src/RageThreads.cpp | 40 ++--------------------------------- stepmania/src/RageThreads.h | 2 -- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/stepmania/src/RageThreads.cpp b/stepmania/src/RageThreads.cpp index 0f389244b3..639e725bc9 100644 --- a/stepmania/src/RageThreads.cpp +++ b/stepmania/src/RageThreads.cpp @@ -190,8 +190,7 @@ static ThreadSlot *GetUnknownThreadSlot() return g_pUnknownThreadSlot; } -RageThread::RageThread(): - m_bThisThread( false ) +RageThread::RageThread() { m_pSlot = NULL; } @@ -247,36 +246,6 @@ void RageThread::Create( int (*fn)(void *), void *data ) m_pSlot->pImpl = MakeThread( fn, data, &m_pSlot->id ); } -void RageThread::CreateThisThread() -{ - ASSERT( m_pSlot == NULL ); - - InitThreads(); - m_bThisThread = true; - LockMut( g_ThreadSlotsLock ); - - 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->name, "Jon" ); - } - else - { - strcpy( m_pSlot->name, name.c_str() ); - } - sprintf( m_pSlot->ThreadFormattedOutput, "Thread: %s", name.c_str() ); - - m_pSlot->id = GetThisThreadId(); - m_pSlot->pImpl = MakeThisThread(); -} - RageThreadRegister::RageThreadRegister( const CString &sName ) { InitThreads(); @@ -338,12 +307,7 @@ int RageThread::Wait() { ASSERT( m_pSlot != NULL ); ASSERT( m_pSlot->pImpl != NULL ); - int ret; - - if( m_bThisThread ) - ret = 0; - else - ret = m_pSlot->pImpl->Wait(); + int ret = m_pSlot->pImpl->Wait(); LockMut( g_ThreadSlotsLock ); diff --git a/stepmania/src/RageThreads.h b/stepmania/src/RageThreads.h index bab4a8f41a..f042290d01 100644 --- a/stepmania/src/RageThreads.h +++ b/stepmania/src/RageThreads.h @@ -14,7 +14,6 @@ public: void SetName( const CString &n ) { name = n; } CString GetName() const { return name; } void Create( int (*fn)(void *), void *data ); - void CreateThisThread(); /* For crash handlers: kill or suspend all threads (except for * the running one) immediately. */ @@ -43,7 +42,6 @@ public: private: ThreadSlot *m_pSlot; CString name; - bool m_bThisThread; static bool s_bSystemSupportsTLS; static bool s_bIsShowingDialog;