diff options
Diffstat (limited to 'src/server/Broadcaster.cpp')
-rw-r--r-- | src/server/Broadcaster.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/Broadcaster.cpp b/src/server/Broadcaster.cpp index 8e53164f..fa8624df 100644 --- a/src/server/Broadcaster.cpp +++ b/src/server/Broadcaster.cpp @@ -15,7 +15,6 @@ */ #include <utility> -#include <glibmm/thread.h> #include "ingen/Interface.hpp" @@ -33,7 +32,7 @@ Broadcaster::Broadcaster() Broadcaster::~Broadcaster() { - Glib::Mutex::Lock lock(_clients_mutex); + std::lock_guard<std::mutex> lock(_clients_mutex); _clients.clear(); _broadcastees.clear(); } @@ -44,7 +43,7 @@ void Broadcaster::register_client(const Raul::URI& uri, SPtr<Interface> client) { - Glib::Mutex::Lock lock(_clients_mutex); + std::lock_guard<std::mutex> lock(_clients_mutex); _clients[uri] = client; } @@ -55,7 +54,7 @@ Broadcaster::register_client(const Raul::URI& uri, bool Broadcaster::unregister_client(const Raul::URI& uri) { - Glib::Mutex::Lock lock(_clients_mutex); + std::lock_guard<std::mutex> lock(_clients_mutex); const size_t erased = _clients.erase(uri); _broadcastees.erase(uri); return (erased > 0); @@ -78,7 +77,7 @@ Broadcaster::set_broadcast(const Raul::URI& client, bool broadcast) SPtr<Interface> Broadcaster::client(const Raul::URI& uri) { - Glib::Mutex::Lock lock(_clients_mutex); + std::lock_guard<std::mutex> lock(_clients_mutex); Clients::iterator i = _clients.find(uri); if (i != _clients.end()) { return (*i).second; @@ -90,7 +89,7 @@ Broadcaster::client(const Raul::URI& uri) void Broadcaster::send_plugins(const BlockFactory::Plugins& plugins) { - Glib::Mutex::Lock lock(_clients_mutex); + std::lock_guard<std::mutex> lock(_clients_mutex); for (const auto& c : _clients) { send_plugins_to(c.second.get(), plugins); } |