add StartDecodeThread to fix potential GetSampleRate race

(will break sound drivers until I update them)
This commit is contained in:
Glenn Maynard
2004-04-02 21:28:06 +00:00
parent 83bd2a6b14
commit 1060269709
2 changed files with 10 additions and 1 deletions
@@ -288,12 +288,17 @@ void RageSound_Generic_Software::StopMixing( RageSoundBase *snd )
}
void RageSound_Generic_Software::StartDecodeThread()
{
ASSERT( !m_DecodeThread.IsCreated() );
m_DecodeThread.Create( DecodeThread_start, this );
}
RageSound_Generic_Software::RageSound_Generic_Software()
{
shutdown_decode_thread = false;
m_DecodeThread.SetName("Decode thread");
m_DecodeThread.Create( DecodeThread_start, this );
}
RageSound_Generic_Software::~RageSound_Generic_Software()
@@ -86,6 +86,10 @@ class RageSound_Generic_Software: public RageSoundDriver
bool GetDataForSound( sound &s );
protected:
/* Start the decoding. This should be called once the hardware is set up and
* GetSampleRate will return the correct value. */
void StartDecodeThread();
/* Override this to set the priority of the decoding thread, which should be above
* normal priority but not realtime. */
virtual void SetupDecodingThread() { }