(cobra bots) set thread name for utility threads

This commit is contained in:
Benjamin Sergeant 2020-06-04 09:52:35 -07:00
parent 1c6ff733f9
commit abd6581242

View File

@ -8,6 +8,7 @@
#include <ixcobra/IXCobraConnection.h> #include <ixcobra/IXCobraConnection.h>
#include <ixcore/utils/IXCoreLogger.h> #include <ixcore/utils/IXCoreLogger.h>
#include <ixwebsocket/IXSetThreadName.h>
#include <algorithm> #include <algorithm>
#include <chrono> #include <chrono>
@ -54,6 +55,7 @@ namespace ix
&receivedCountPerMinutes, &receivedCountPerMinutes,
&minuteCounter, &minuteCounter,
&stop] { &stop] {
setThreadName("Bot progress");
while (!stop) while (!stop)
{ {
// //
@ -94,6 +96,7 @@ namespace ix
std::thread t1(timer); std::thread t1(timer);
auto heartbeat = [&sentCount, &receivedCount, &stop, &enableHeartbeat, &heartBeatTimeout, &fatalCobraError] { auto heartbeat = [&sentCount, &receivedCount, &stop, &enableHeartbeat, &heartBeatTimeout, &fatalCobraError] {
setThreadName("Bot heartbeat");
std::string state("na"); std::string state("na");
if (!enableHeartbeat) return; if (!enableHeartbeat) return;