aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-15 19:07:25 +0100
committerMax Kellermann <max@duempel.org>2013-12-15 19:07:25 +0100
commit42a09ff17a47ec670b9a6d3ecd0aae14e0d52cde (patch)
treed63674c701e905c68aaad9609f64b194104ae286
parentc170fed6f9a747bfe9e4e53a85ebc2e92a70bab6 (diff)
downloadmpd-42a09ff17a47ec670b9a6d3ecd0aae14e0d52cde.tar.gz
mpd-42a09ff17a47ec670b9a6d3ecd0aae14e0d52cde.tar.xz
mpd-42a09ff17a47ec670b9a6d3ecd0aae14e0d52cde.zip
mixer/alsa: fix deadlock
This deadlock was a regression by commit 8e38b4f8. Since we currently can't resolve this, let's revert the commit, and add a GLib specific workaround for the build failure.
Diffstat (limited to '')
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx
index b81ca4246..4a4ca433c 100644
--- a/src/mixer/AlsaMixerPlugin.cxx
+++ b/src/mixer/AlsaMixerPlugin.cxx
@@ -47,10 +47,22 @@ class AlsaMixerMonitor final : private MultiSocketMonitor {
public:
AlsaMixerMonitor(EventLoop &_loop, snd_mixer_t *_mixer)
:MultiSocketMonitor(_loop), mixer(_mixer) {
- BlockingCall(_loop, [this](){ InvalidateSockets(); });
+#ifdef USE_EPOLL
+ _loop.AddCall([this](){ InvalidateSockets(); });
+#else
+ _loop.AddIdle(InitAlsaMixerMonitor, this);
+#endif
}
private:
+#ifndef USE_EPOLL
+ static gboolean InitAlsaMixerMonitor(gpointer data) {
+ AlsaMixerMonitor &amm = *(AlsaMixerMonitor *)data;
+ amm.InvalidateSockets();
+ return false;
+ }
+#endif
+
virtual int PrepareSockets() override;
virtual void DispatchSockets() override;
};