From 42a09ff17a47ec670b9a6d3ecd0aae14e0d52cde Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 15 Dec 2013 19:07:25 +0100 Subject: [PATCH] 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. --- src/mixer/AlsaMixerPlugin.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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; };