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)
, fStateChangeSignal()
, fStateChangeSignalsMap()
, fWorkerThread()
, fTerminationRequested(false)
, fWorkerThread()
{}
virtual ~FairMQFSM()

View File

@ -108,7 +108,7 @@ void FairMQBenchmarkSampler::Run()
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);
MyDevice device;
device.CatchSignals();
// device.CatchSignals();
device.SetConfig(config);
// 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()
, fEventsMutex()
, fNewEvent()
, fDeviceTerminationRequested(false)
{
try
{
@ -67,6 +68,10 @@ auto DDS::HandleControl() -> void
fEvents.push(newState);
}
fNewEvent.notify_one();
if (newState == DeviceState::Exiting)
{
fDeviceTerminationRequested = true;
}
});
ChangeDeviceState(DeviceStateTransition::InitDevice);
@ -100,7 +105,7 @@ auto DDS::HandleControl() -> void
// wait until stop signal
unique_lock<mutex> lock(fStopMutex);
while (!DeviceTerminated())
while (!fDeviceTerminationRequested)
{
fStopCondition.wait_for(lock, chrono::seconds(1));
}
@ -129,7 +134,7 @@ auto DDS::FillChannelContainers() -> void
if (GetProperty<string>(methodKey) == "bind")
{
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));
}
@ -138,7 +143,7 @@ auto DDS::FillChannelContainers() -> void
{
fConnectingChans.insert(make_pair(c.first, DDSConfig()));
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());
}

View File

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

View File

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