add a missing lock and some checkpoints

This commit is contained in:
Glenn Maynard
2002-12-20 07:00:12 +00:00
parent 7aebbffedc
commit a39f632a5f
@@ -40,12 +40,14 @@ void RageSound_DSound::MixerThread()
VDCHECKPOINT; VDCHECKPOINT;
while(!shutdown) { while(!shutdown) {
VDCHECKPOINT;
Sleep(10); Sleep(10);
/* SOUNDMAN will be set once RageSoundManager's ctor returns and /* SOUNDMAN will be set once RageSoundManager's ctor returns and
* assigns it; we might get here before that happens, though. */ * assigns it; we might get here before that happens, though. */
if(!SOUNDMAN) continue; if(!SOUNDMAN) continue;
VDCHECKPOINT;
LockMutex L(SOUNDMAN->lock); LockMutex L(SOUNDMAN->lock);
for(unsigned i = 0; i < stream_pool.size(); ++i) for(unsigned i = 0; i < stream_pool.size(); ++i)
{ {
@@ -88,6 +90,7 @@ void RageSound_DSound::Update(float delta)
* it in the opposite buffer. */ * it in the opposite buffer. */
void RageSound_DSound::stream::GetPCM(bool init) void RageSound_DSound::stream::GetPCM(bool init)
{ {
VDCHECKPOINT;
DWORD cursor, junk; DWORD cursor, junk;
HRESULT result; HRESULT result;
@@ -239,6 +242,8 @@ RageSound_DSound::~RageSound_DSound()
void RageSound_DSound::StartMixing(RageSound *snd) void RageSound_DSound::StartMixing(RageSound *snd)
{ {
LockMutex L(SOUNDMAN->lock);
/* Find an unused buffer. */ /* Find an unused buffer. */
unsigned i; unsigned i;
for(i = 0; i < stream_pool.size(); ++i) { for(i = 0; i < stream_pool.size(); ++i) {