virtual ~Impl()
		{
			if(inputThread.IsCreated()) {
				continueInputThread = false;
				inputThread.Wait();
			}
		}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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 );
}
Exemplo n.º 4
0
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);
		}