mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Use future instead of thread for device rateLogger
This commit is contained in:
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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user