virtual ~Impl() { if(inputThread.IsCreated()) { continueInputThread = false; inputThread.Wait(); } }
GameSoundManager::~GameSoundManager() { if( g_ThreadedMusicStart ) { /* Signal the mixing thread to quit. */ g_Shutdown = true; LOG->Trace("Shutting down music start thread ..."); MusicThread.Wait(); LOG->Trace("Music start thread shut down."); } delete g_Playing; delete g_Mutex; CString *p; while( g_SoundsToPlayOnce.read( &p, 1 ) ) delete p; while( g_SoundsToPlayOnceFromDir.read( &p, 1 ) ) delete p; while( g_SoundsToPlayOnceFromAnnouncer.read( &p, 1 ) ) delete p; MusicToPlay *pMusic; while( g_MusicsToPlay.read( &pMusic, 1 ) ) delete pMusic; }
static void TestTLS() { /* TLS won't work on older threads libraries, and may crash. */ if( !UsingNPTL() ) return; /* TLS won't work on older Linux kernels. Do a simple check. */ g_iTestTLS = 1; RageThread TestThread; TestThread.SetName( "TestTLS" ); TestThread.Create( TestTLSThread, NULL ); TestThread.Wait(); if( g_iTestTLS == 1 ) RageThread::SetSupportsTLS( true ); }
GameSoundManager::GameSoundManager() { /* Init RageSoundMan first: */ ASSERT( SOUNDMAN ); g_SoundsToPlayOnce.reserve( 16 ); g_SoundsToPlayOnceFromDir.reserve( 16 ); g_SoundsToPlayOnceFromAnnouncer.reserve( 16 ); g_MusicsToPlay.reserve( 16 ); g_Mutex = new RageMutex("GameSoundManager"); g_Playing = new MusicPlaying( new RageSound ); g_UpdatingTimer = false; if( g_ThreadedMusicStart ) { g_Shutdown = false; MusicThread.SetName( "MusicThread" ); MusicThread.Create( MusicThread_start, this ); } }
inline void createThread() { continueInputThread = true; inputThread.SetName("SextetStream input thread"); inputThread.Create(StartInputThread, this); }