From 55d5ab7a7b638f338f13a2d875f440f1af065122 Mon Sep 17 00:00:00 2001 From: ImBenji Date: Tue, 2 Dec 2025 14:45:56 +0000 Subject: [PATCH] Refactor concurrency header to replace iosfwd with string and improve thread capture in initialiseMasterAsync --- cpp/src/Public/sweepstore/concurrency.h | 4 ++-- cpp/src/Public/sweepstore/utils/helpers.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/src/Public/sweepstore/concurrency.h b/cpp/src/Public/sweepstore/concurrency.h index 8305818..4baa373 100644 --- a/cpp/src/Public/sweepstore/concurrency.h +++ b/cpp/src/Public/sweepstore/concurrency.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include #define STALE_HEARTBEAT_THRESHOLD_MS 5000 @@ -22,7 +22,7 @@ namespace SweepstoreConcurrency { void initialiseMaster(std::string filePath); inline void initialiseMasterAsync(std::string filePath) { - std::thread([&filePath]() { + std::thread([filePath]() { initialiseMaster(filePath); }).detach(); } diff --git a/cpp/src/Public/sweepstore/utils/helpers.h b/cpp/src/Public/sweepstore/utils/helpers.h index 851b4ee..0624a0d 100644 --- a/cpp/src/Public/sweepstore/utils/helpers.h +++ b/cpp/src/Public/sweepstore/utils/helpers.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include // Toggleable debug printing via preprocessor #ifndef SWEEPSTORE_DEBUG