DDS plugin: fix exiting timeout

This commit is contained in:
Alexey Rybalchenko
2020-02-20 15:53:02 +01:00
committed by Dennis Klein
parent 21835cc104
commit beff0af51b
3 changed files with 5 additions and 4 deletions

View File

@@ -92,6 +92,9 @@ DDS::DDS(const string& name,
break;
}
case DeviceState::Exiting:
if (!fControllerThread.joinable()) {
fControllerThread = thread(&DDS::WaitForExitingAck, this);
}
fWorkGuard.reset();
fDeviceTerminationRequested = true;
UnsubscribeFromDeviceStateChange();
@@ -358,9 +361,6 @@ auto DDS::SubscribeForCustomCommands() -> void
case cmd::Type::subscribe_to_state_change: {
lock_guard<mutex> lock{fStateChangeSubscriberMutex};
fStateChangeSubscribers.insert(senderId);
if (!fControllerThread.joinable()) {
fControllerThread = thread(&DDS::WaitForExitingAck, this);
}
LOG(debug) << "Publishing state-change: " << fLastState << "->" << fCurrentState
<< " to " << senderId;