From c13facdaca7ee3c9ddb9ccc3e7b75654bc268276 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 11:02:04 +0100 Subject: db/upnp/WorkQueue: pass reference to take() --- src/db/upnp/Discovery.cxx | 2 +- src/db/upnp/WorkQueue.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/db/upnp/Discovery.cxx b/src/db/upnp/Discovery.cxx index 9d2b8dbd0..89f01df2a 100644 --- a/src/db/upnp/Discovery.cxx +++ b/src/db/upnp/Discovery.cxx @@ -109,7 +109,7 @@ discoExplorer(void *) { for (;;) { DiscoveredTask *tsk = 0; - if (!discoveredQueue.take(&tsk)) { + if (!discoveredQueue.take(tsk)) { discoveredQueue.workerExit(); return (void*)1; } diff --git a/src/db/upnp/WorkQueue.hxx b/src/db/upnp/WorkQueue.hxx index 0f62ee457..d1ab7ec43 100644 --- a/src/db/upnp/WorkQueue.hxx +++ b/src/db/upnp/WorkQueue.hxx @@ -241,7 +241,7 @@ public: * Sleeps if there are not enough. Signal if we go to sleep on empty * queue: client may be waiting for our going idle. */ - bool take(T* tp) + bool take(T &tp) { const ScopeLock protect(m_mutex); @@ -266,7 +266,7 @@ public: m_workers_waiting--; } - *tp = m_queue.front(); + tp = m_queue.front(); m_queue.pop(); if (m_clients_waiting > 0) { // No reason to wake up more than one client thread -- cgit v1.2.3