Prevent some data race conditions (pointed out by Coverity)

This commit is contained in:
twinaphex 2016-05-24 21:27:58 +02:00
parent 46872f8fcb
commit 8a71830d44
2 changed files with 3 additions and 1 deletions

View File

@ -81,8 +81,8 @@ static void audio_thread_loop(void *data)
if (!thr->alive)
{
scond_signal(thr->cond);
slock_unlock(thr->lock);
thr->stopped_ack = true;
slock_unlock(thr->lock);
break;
}

View File

@ -132,7 +132,9 @@ static void alsa_thread_free(void *data)
{
if (alsa->worker_thread)
{
slock_lock(alsa->cond_lock);
alsa->thread_dead = true;
slock_unlock(alsa->cond_lock);
sthread_join(alsa->worker_thread);
}
if (alsa->buffer)