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
+8
View File
@@ -23,8 +23,16 @@
#include "mixer_plugin.h"
#include "mixer_list.h"
#include <glib.h>
struct mixer {
const struct mixer_plugin *plugin;
/**
* This mutex protects all of the mixer struct, including its
* implementation, so plugins don't have to deal with that.
*/
GMutex *mutex;
};
void