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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user