Gracefully end the device also in the termination case (instead of abort).

This commit is contained in:
Alexey Rybalchenko
2016-05-17 08:55:42 +02:00
parent ce42f36126
commit e9f09143b2
3 changed files with 40 additions and 37 deletions

View File

@@ -48,13 +48,16 @@ inline int runStateMachine(TMQDevice& device, FairMQProgOptions& config)
{
device.WaitForEndOfState(TMQDevice::RUN);
device.ChangeState(TMQDevice::RESET_TASK);
device.WaitForEndOfState(TMQDevice::RESET_TASK);
if (!device.CheckCurrentState(TMQDevice::EXITING))
{
device.ChangeState(TMQDevice::RESET_TASK);
device.WaitForEndOfState(TMQDevice::RESET_TASK);
device.ChangeState(TMQDevice::RESET_DEVICE);
device.WaitForEndOfState(TMQDevice::RESET_DEVICE);
device.ChangeState(TMQDevice::RESET_DEVICE);
device.WaitForEndOfState(TMQDevice::RESET_DEVICE);
device.ChangeState(TMQDevice::END);
device.ChangeState(TMQDevice::END);
}
}
else
{