From 4739bb6a1565e69492eb0349298d86d4d0daad38 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 10 May 2026 00:53:20 +0100 Subject: Force use of std::launch::async Deferred policy is not good enough to avoid blocking the main thread... it would just mean in blocked later and that's not the point here. --- src/ingestor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ingestor.cpp b/src/ingestor.cpp index 5d7243a..88bea9f 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -308,7 +308,7 @@ namespace WebStat { if (processingLines.empty()) { std::swap(queuedLines, processingLines); } - return {storeQueueLines.currentRun.emplace(std::async(storeQueueLines.impl, this)), true}; + return {storeQueueLines.currentRun.emplace(std::async(std::launch::async, storeQueueLines.impl, this)), true}; } Ingestor::Job::Result @@ -454,7 +454,7 @@ namespace WebStat { } else if (expired(job.lastRun, freq, now)) { if (!job.cond || std::invoke(job.cond, this)) { - job.currentRun.emplace(std::async(job.impl, this)); + job.currentRun.emplace(std::async(std::launch::async, job.impl, this)); } } }; -- cgit v1.3