mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
DDS Plugin: reset channel containers before filling
This commit is contained in:
committed by
Dennis Klein
parent
44bfbe02ed
commit
dc72262af1
@@ -100,8 +100,12 @@ DDS::DDS(const string& name,
|
||||
PublishBoundChannels();
|
||||
break;
|
||||
case DeviceState::ResettingDevice: {
|
||||
std::lock_guard<std::mutex> lk(fUpdateMutex);
|
||||
fUpdatesAllowed = false;
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(fUpdateMutex);
|
||||
fUpdatesAllowed = false;
|
||||
}
|
||||
|
||||
EmptyChannelContainers();
|
||||
break;
|
||||
}
|
||||
case DeviceState::Exiting:
|
||||
@@ -127,13 +131,7 @@ DDS::DDS(const string& name,
|
||||
if (staticMode) {
|
||||
fControllerThread = thread(&DDS::StaticControl, this);
|
||||
} else {
|
||||
fWorkerThread = thread([this]() {
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(fUpdateMutex);
|
||||
fUpdateCondition.wait(lk, [&]{ return fUpdatesAllowed; });
|
||||
}
|
||||
fWorkerQueue.run();
|
||||
});
|
||||
StartWorkerThread();
|
||||
}
|
||||
|
||||
fDDS.Start();
|
||||
@@ -144,6 +142,19 @@ DDS::DDS(const string& name,
|
||||
}
|
||||
}
|
||||
|
||||
void DDS::EmptyChannelContainers()
|
||||
{
|
||||
fBindingChans.clear();
|
||||
fConnectingChans.clear();
|
||||
}
|
||||
|
||||
auto DDS::StartWorkerThread() -> void
|
||||
{
|
||||
fWorkerThread = thread([this]() {
|
||||
fWorkerQueue.run();
|
||||
});
|
||||
}
|
||||
|
||||
auto DDS::WaitForExitingAck() -> void
|
||||
{
|
||||
unique_lock<mutex> lock(fStateChangeSubscriberMutex);
|
||||
@@ -257,6 +268,10 @@ auto DDS::SubscribeForConnectingChannels() -> void
|
||||
|
||||
boost::asio::post(fWorkerQueue, [=]() {
|
||||
try {
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(fUpdateMutex);
|
||||
fUpdateCondition.wait(lk, [&]{ return fUpdatesAllowed; });
|
||||
}
|
||||
string val = value;
|
||||
// check if it is to handle as one out of multiple values
|
||||
auto it = fIofN.find(propertyId);
|
||||
|
Reference in New Issue
Block a user