mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Use future instead of thread for device rateLogger
This commit is contained in:
committed by
Dennis Klein
parent
1aab354a5d
commit
45354f268b
@@ -24,6 +24,7 @@
|
||||
#include <functional>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <future>
|
||||
#include <algorithm> // std::max
|
||||
|
||||
using namespace std;
|
||||
@@ -491,7 +492,7 @@ void FairMQDevice::RunWrapper()
|
||||
LOG(info) << "DEVICE: Running...";
|
||||
|
||||
// start the rate logger thread
|
||||
thread rateLogger(&FairMQDevice::LogSocketRates, this);
|
||||
future<void> rateLogger = async(launch::async, &FairMQDevice::LogSocketRates, this);
|
||||
|
||||
// notify transports to resume transfers
|
||||
{
|
||||
@@ -552,7 +553,7 @@ void FairMQDevice::RunWrapper()
|
||||
|
||||
CallAndHandleError(std::bind(&FairMQDevice::PostRun, this));
|
||||
|
||||
rateLogger.join();
|
||||
rateLogger.get();
|
||||
}
|
||||
|
||||
void FairMQDevice::HandleSingleChannelInput()
|
||||
|
Reference in New Issue
Block a user