mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +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 <functional>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <future>
|
||||||
#include <algorithm> // std::max
|
#include <algorithm> // std::max
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -491,7 +492,7 @@ void FairMQDevice::RunWrapper()
|
||||||
LOG(info) << "DEVICE: Running...";
|
LOG(info) << "DEVICE: Running...";
|
||||||
|
|
||||||
// start the rate logger thread
|
// start the rate logger thread
|
||||||
thread rateLogger(&FairMQDevice::LogSocketRates, this);
|
future<void> rateLogger = async(launch::async, &FairMQDevice::LogSocketRates, this);
|
||||||
|
|
||||||
// notify transports to resume transfers
|
// notify transports to resume transfers
|
||||||
{
|
{
|
||||||
|
@ -552,7 +553,7 @@ void FairMQDevice::RunWrapper()
|
||||||
|
|
||||||
CallAndHandleError(std::bind(&FairMQDevice::PostRun, this));
|
CallAndHandleError(std::bind(&FairMQDevice::PostRun, this));
|
||||||
|
|
||||||
rateLogger.join();
|
rateLogger.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FairMQDevice::HandleSingleChannelInput()
|
void FairMQDevice::HandleSingleChannelInput()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user