From 36ea6fbff8e7c5601202441165ba97fd49a9eff4 Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sat, 7 Apr 2018 21:57:11 +0200 Subject: [PATCH] Revert "fix(pulseaudio): add mutex for queue" This reverts commit d430174f0b4c02d5dfc2eb818ed79410a2e19b4b. Mutual exclusion is already guaranteed by the lock on pa_threaded_mainloop Fixes #1139 --- include/adapters/pulseaudio.hpp | 5 ----- src/adapters/pulseaudio.cpp | 3 --- 2 files changed, 8 deletions(-) diff --git a/include/adapters/pulseaudio.hpp b/include/adapters/pulseaudio.hpp index 4f5301a7..1e76df92 100644 --- a/include/adapters/pulseaudio.hpp +++ b/include/adapters/pulseaudio.hpp @@ -2,7 +2,6 @@ #include #include -#include #include "common.hpp" #include "settings.hpp" @@ -19,8 +18,6 @@ typedef struct pa_threaded_mainloop pa_threaded_mainloop; POLYBAR_NS class logger; -using mutex = std::mutex; - DEFINE_ERROR(pulseaudio_error); class pulseaudio { @@ -72,8 +69,6 @@ class pulseaudio { pa_threaded_mainloop* m_mainloop{nullptr}; queue m_events; - mutable mutex m_mutex; - // specified sink name string spec_s_name; diff --git a/src/adapters/pulseaudio.cpp b/src/adapters/pulseaudio.cpp index 75f7e1a5..c787649c 100644 --- a/src/adapters/pulseaudio.cpp +++ b/src/adapters/pulseaudio.cpp @@ -112,8 +112,6 @@ bool pulseaudio::wait() { * Process queued pulseaudio events */ int pulseaudio::process_events() { - std::lock_guard lock(m_mutex); - int ret = m_events.size(); pa_threaded_mainloop_lock(m_mainloop); pa_operation *o{nullptr}; @@ -248,7 +246,6 @@ void pulseaudio::subscribe_callback(pa_context *, pa_subscription_event_type_t t return; switch(t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) { case PA_SUBSCRIPTION_EVENT_SINK: - std::lock_guard lock(This->m_mutex); switch(t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) { case PA_SUBSCRIPTION_EVENT_NEW: This->m_events.emplace(evtype::NEW);