source: DataSource, Frame, SourceConfig and the registry (unused yet)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
71b904a93b
commit
3896f404a9
11 files changed
+445
-3
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// SPDX-FileCopyrightText: 2026 Martino Ferrari
|
||||
|
||||
#include "source/data_source.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace udpscope {
|
||||
|
||||
void DataSource::post(Command cmd) {
|
||||
std::lock_guard<std::mutex> lk(cmd_mu_);
|
||||
cmds_.push_back(std::move(cmd));
|
||||
}
|
||||
|
||||
void DataSource::drain_commands() {
|
||||
std::deque<Command> local;
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(cmd_mu_);
|
||||
local.swap(cmds_);
|
||||
}
|
||||
for (auto& c : local) c();
|
||||
}
|
||||
|
||||
} // namespace udpscope
|
||||
Reference in new issue
Block a user