Refactor concurrency header to replace iosfwd with string and improve thread capture in initialiseMasterAsync
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iosfwd>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#define STALE_HEARTBEAT_THRESHOLD_MS 5000
|
#define STALE_HEARTBEAT_THRESHOLD_MS 5000
|
||||||
@@ -22,7 +22,7 @@ namespace SweepstoreConcurrency {
|
|||||||
void initialiseMaster(std::string filePath);
|
void initialiseMaster(std::string filePath);
|
||||||
|
|
||||||
inline void initialiseMasterAsync(std::string filePath) {
|
inline void initialiseMasterAsync(std::string filePath) {
|
||||||
std::thread([&filePath]() {
|
std::thread([filePath]() {
|
||||||
initialiseMaster(filePath);
|
initialiseMaster(filePath);
|
||||||
}).detach();
|
}).detach();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <cstring>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
// Toggleable debug printing via preprocessor
|
// Toggleable debug printing via preprocessor
|
||||||
#ifndef SWEEPSTORE_DEBUG
|
#ifndef SWEEPSTORE_DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user