db/upnp/WorkQueue: pass reference to take()
This commit is contained in:
@@ -109,7 +109,7 @@ discoExplorer(void *)
|
|||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
DiscoveredTask *tsk = 0;
|
DiscoveredTask *tsk = 0;
|
||||||
if (!discoveredQueue.take(&tsk)) {
|
if (!discoveredQueue.take(tsk)) {
|
||||||
discoveredQueue.workerExit();
|
discoveredQueue.workerExit();
|
||||||
return (void*)1;
|
return (void*)1;
|
||||||
}
|
}
|
||||||
|
@@ -241,7 +241,7 @@ public:
|
|||||||
* Sleeps if there are not enough. Signal if we go to sleep on empty
|
* Sleeps if there are not enough. Signal if we go to sleep on empty
|
||||||
* queue: client may be waiting for our going idle.
|
* queue: client may be waiting for our going idle.
|
||||||
*/
|
*/
|
||||||
bool take(T* tp)
|
bool take(T &tp)
|
||||||
{
|
{
|
||||||
const ScopeLock protect(m_mutex);
|
const ScopeLock protect(m_mutex);
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ public:
|
|||||||
m_workers_waiting--;
|
m_workers_waiting--;
|
||||||
}
|
}
|
||||||
|
|
||||||
*tp = m_queue.front();
|
tp = m_queue.front();
|
||||||
m_queue.pop();
|
m_queue.pop();
|
||||||
if (m_clients_waiting > 0) {
|
if (m_clients_waiting > 0) {
|
||||||
// No reason to wake up more than one client thread
|
// No reason to wake up more than one client thread
|
||||||
|
Reference in New Issue
Block a user