Skip to content

Commit

Permalink
Add Device::ResumeTransports
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx committed Feb 22, 2023
1 parent da1c9e4 commit ae51ecc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
20 changes: 12 additions & 8 deletions fairmq/Device.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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([&](){
Expand Down Expand Up @@ -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();
}
}

Expand All @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions fairmq/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down

0 comments on commit ae51ecc

Please sign in to comment.