Fix warnings and remove deleted file from installation.

This commit is contained in:
Alexey Rybalchenko 2017-09-20 12:51:51 +02:00 committed by Mohammad Al-Turany
parent 44a59f25a7
commit e37e559dce
6 changed files with 15 additions and 7 deletions

View File

@ -90,8 +90,8 @@ struct FairMQFSM : public msmf::state_machine_def<FairMQFSM>
, fWorkAvailable(false) , fWorkAvailable(false)
, fStateChangeSignal() , fStateChangeSignal()
, fStateChangeSignalsMap() , fStateChangeSignalsMap()
, fWorkerThread()
, fTerminationRequested(false) , fTerminationRequested(false)
, fWorkerThread()
{} {}
virtual ~FairMQFSM() virtual ~FairMQFSM()

View File

@ -108,7 +108,7 @@ void FairMQBenchmarkSampler::Run()
auto tEnd = chrono::high_resolution_clock::now(); auto tEnd = chrono::high_resolution_clock::now();
LOG(INFO) << "Leaving RUNNING state. Done " << fNumIterations << " iterations in " << chrono::duration<double, milli>(tEnd - tStart).count() << "ms."; LOG(INFO) << "Done " << fNumIterations << " iterations in " << chrono::duration<double, milli>(tEnd - tStart).count() << "ms.";
} }

View File

@ -89,7 +89,7 @@ int main(int argc, char** argv)
// config.UpdateChannelMap(map2); // config.UpdateChannelMap(map2);
MyDevice device; MyDevice device;
device.CatchSignals(); // device.CatchSignals();
device.SetConfig(config); device.SetConfig(config);
// getting as string and conversion helpers // getting as string and conversion helpers

View File

@ -34,6 +34,7 @@ DDS::DDS(const string name, const Plugin::Version version, const string maintain
, fEvents() , fEvents()
, fEventsMutex() , fEventsMutex()
, fNewEvent() , fNewEvent()
, fDeviceTerminationRequested(false)
{ {
try try
{ {
@ -67,6 +68,10 @@ auto DDS::HandleControl() -> void
fEvents.push(newState); fEvents.push(newState);
} }
fNewEvent.notify_one(); fNewEvent.notify_one();
if (newState == DeviceState::Exiting)
{
fDeviceTerminationRequested = true;
}
}); });
ChangeDeviceState(DeviceStateTransition::InitDevice); ChangeDeviceState(DeviceStateTransition::InitDevice);
@ -100,7 +105,7 @@ auto DDS::HandleControl() -> void
// wait until stop signal // wait until stop signal
unique_lock<mutex> lock(fStopMutex); unique_lock<mutex> lock(fStopMutex);
while (!DeviceTerminated()) while (!fDeviceTerminationRequested)
{ {
fStopCondition.wait_for(lock, chrono::seconds(1)); fStopCondition.wait_for(lock, chrono::seconds(1));
} }
@ -129,7 +134,7 @@ auto DDS::FillChannelContainers() -> void
if (GetProperty<string>(methodKey) == "bind") if (GetProperty<string>(methodKey) == "bind")
{ {
fBindingChans.insert(make_pair(c.first, vector<string>())); fBindingChans.insert(make_pair(c.first, vector<string>()));
for (unsigned int i = 0; i < c.second; ++i) for (int i = 0; i < c.second; ++i)
{ {
fBindingChans.at(c.first).push_back(GetProperty<string>(addressKey)); fBindingChans.at(c.first).push_back(GetProperty<string>(addressKey));
} }
@ -138,7 +143,7 @@ auto DDS::FillChannelContainers() -> void
{ {
fConnectingChans.insert(make_pair(c.first, DDSConfig())); fConnectingChans.insert(make_pair(c.first, DDSConfig()));
LOG(DEBUG) << "preparing to connect: " << c.first << " with " << c.second << " sub-channels."; LOG(DEBUG) << "preparing to connect: " << c.first << " with " << c.second << " sub-channels.";
for (unsigned int i = 0; i < c.second; ++i) for (int i = 0; i < c.second; ++i)
{ {
fConnectingChans.at(c.first).fSubChannelAddresses.push_back(string()); fConnectingChans.at(c.first).fSubChannelAddresses.push_back(string());
} }

View File

@ -74,6 +74,8 @@ class DDS : public Plugin
std::queue<DeviceState> fEvents; std::queue<DeviceState> fEvents;
std::mutex fEventsMutex; std::mutex fEventsMutex;
std::condition_variable fNewEvent; std::condition_variable fNewEvent;
std::atomic<bool> fDeviceTerminationRequested;
}; };
REGISTER_FAIRMQ_PLUGIN( REGISTER_FAIRMQ_PLUGIN(

View File

@ -36,7 +36,8 @@ inline auto control(std::shared_ptr<FairMQDevice> device) -> void
struct PluginServices : ::testing::Test { struct PluginServices : ::testing::Test {
PluginServices() PluginServices()
: mDevice{std::make_shared<FairMQDevice>()} : mConfig()
, mDevice{std::make_shared<FairMQDevice>()}
, mServices{&mConfig, mDevice} , mServices{&mConfig, mDevice}
{ {
mDevice->SetTransport("zeromq"); mDevice->SetTransport("zeromq");