Refactor concurrency header to replace iosfwd with string and improve thread capture in initialiseMasterAsync

This commit is contained in:
ImBenji
2025-12-02 14:45:56 +00:00
parent b3790e6b0a
commit 55d5ab7a7b
2 changed files with 4 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
#include <cstdint>
#include <functional>
#include <iosfwd>
#include <string>
#include <thread>
#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();
}

View File

@@ -9,6 +9,8 @@
#include <fstream>
#include <chrono>
#include <thread>
#include <cstring>
#include <algorithm>
// Toggleable debug printing via preprocessor
#ifndef SWEEPSTORE_DEBUG