Remove redundant state change call and revert the termination handler.

This commit is contained in:
Alexey Rybalchenko 2016-05-12 15:21:12 +02:00 committed by Mohammad Al-Turany
parent 28aa5e4caa
commit ce42f36126
2 changed files with 13 additions and 13 deletions

View File

@ -90,18 +90,19 @@ void FairMQDevice::SignalHandler(int signal)
fTerminateStateThread.join(); fTerminateStateThread.join();
stop(); stop();
fRunning = false; exit(EXIT_FAILURE);
if (!fTerminated) // fRunning = false;
{ // if (!fTerminated)
fTerminated = true; // {
LOG(INFO) << "Exiting."; // fTerminated = true;
} // LOG(INFO) << "Exiting.";
else // }
{ // else
LOG(WARN) << "Repeated termination or bad initialization? Aborting."; // {
// std::abort(); // LOG(WARN) << "Repeated termination or bad initialization? Aborting.";
exit(EXIT_FAILURE); // // std::abort();
} // exit(EXIT_FAILURE);
// }
} }
void FairMQDevice::ConnectChannels(list<FairMQChannel*>& chans) void FairMQDevice::ConnectChannels(list<FairMQChannel*>& chans)

View File

@ -46,7 +46,6 @@ inline int runStateMachine(TMQDevice& device, FairMQProgOptions& config)
} }
else if (control == "static") else if (control == "static")
{ {
device.ChangeState(TMQDevice::RUN);
device.WaitForEndOfState(TMQDevice::RUN); device.WaitForEndOfState(TMQDevice::RUN);
device.ChangeState(TMQDevice::RESET_TASK); device.ChangeState(TMQDevice::RESET_TASK);