mixer: protect the mixer struct with a mutex

In some rare cases, there was a race condition between the output
thread and the main thread: when you disable/enable an output device
in the main thread, this caused a crash in the output thread.  Protect
the whole mixer struct with a GMutex to prevent that.
This commit is contained in:
Max Kellermann
2009-03-14 11:53:28 +01:00
parent 82963ee023
commit 7deade8577
3 changed files with 37 additions and 5 deletions

View File

@@ -19,8 +19,6 @@
#include "mixer_api.h"
#include <glib.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "mixer"
@@ -28,4 +26,5 @@ void
mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin)
{
mixer->plugin = plugin;
mixer->mutex = g_mutex_new();
}