mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-15 01:01:46 +02:00
Remove MetadataAdapter
This commit is contained in:
parent
afa8c118f6
commit
f8e4e60f2f
7 changed files with 38 additions and 123 deletions
|
@ -1,6 +1,6 @@
|
|||
/***
|
||||
This file is part of snapcast
|
||||
Copyright (C) 2014-2024 Johannes Pohl
|
||||
Copyright (C) 2014-2025 Johannes Pohl
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -25,6 +25,7 @@
|
|||
#include <mutex>
|
||||
|
||||
|
||||
/// Queue with "wait for new element" functionality
|
||||
template <typename T>
|
||||
class Queue
|
||||
{
|
||||
|
@ -32,8 +33,7 @@ public:
|
|||
T pop()
|
||||
{
|
||||
std::unique_lock<std::mutex> mlock(mutex_);
|
||||
while (queue_.empty())
|
||||
cond_.wait(mlock);
|
||||
cond_.wait(mlock, [this]() { return queue_.empty(); });
|
||||
|
||||
// std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto val = queue_.front();
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
{
|
||||
std::unique_lock<std::mutex> mlock(mutex_);
|
||||
abort_ = false;
|
||||
if (!cond_.wait_for(mlock, timeout, [this] { return (!queue_.empty() || abort_); }))
|
||||
if (!cond_.wait_for(mlock, timeout, [this]() { return (!queue_.empty() || abort_); }))
|
||||
return false;
|
||||
|
||||
return !queue_.empty() && !abort_;
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
abort_ = false;
|
||||
if (timeout.count() > 0)
|
||||
{
|
||||
if (!cond_.wait_for(mlock, timeout, [this] { return (!queue_.empty() || abort_); }))
|
||||
if (!cond_.wait_for(mlock, timeout, [this]() { return (!queue_.empty() || abort_); }))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue