Add Device::ResumeTransports

This commit is contained in:
Alexey Rybalchenko 2023-02-22 12:23:28 +01:00
parent da1c9e4400
commit ae51ecc659
2 changed files with 15 additions and 8 deletions

View File

@ -457,11 +457,8 @@ void Device::RunWrapper()
if (rateLogging && rateLogger->joinable()) { rateLogger->join(); }
});
// notify transports to resume transfers
for (auto& t : fTransports) {
t.second->Resume();
}
ResumeTransports();
// change to Error state in case of an exception, to release LogSocketRates
tools::CallOnDestruction cod([&](){
@ -773,8 +770,15 @@ void Device::LogSocketRates()
void Device::InterruptTransports()
{
for (auto& transport : fTransports) {
transport.second->Interrupt();
for (auto& [transportType, transport] : fTransports) {
transport->Interrupt();
}
}
void Device::ResumeTransports()
{
for (auto& [transportType, transport] : fTransports) {
transport->Resume();
}
}
@ -789,8 +793,8 @@ void Device::ResetTaskWrapper()
void Device::ResetWrapper()
{
for (auto& transport : fTransports) {
transport.second->Reset();
for (auto& [transportType, transport] : fTransports) {
transport->Reset();
}
Reset();

View File

@ -590,6 +590,9 @@ class Device
/// Notifies transports to cease any blocking activity
void InterruptTransports();
/// Notifies transports to resume any blocking activity
void ResumeTransports();
/// Shuts down the transports and the device
void Exit() {}