Refactor concurrency header to replace iosfwd with string and improve thread capture in initialiseMasterAsync
This commit is contained in:
parent
b3790e6b0a
commit
55d5ab7a7b
2 changed files with 4 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
#include <fstream>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
// Toggleable debug printing via preprocessor
|
||||
#ifndef SWEEPSTORE_DEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue