aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-01-07 13:01:43 +0100
committerMartin Ridgers <[email protected]>2022-01-07 13:55:27 +0100
commit4558d1f477830ce52054669ab8f33838f3c90c79 (patch)
tree6f5418451d93d2dd230abaaf7f6ac0f5d7e857f7
parentMissing override decoration (diff)
downloadzen-4558d1f477830ce52054669ab8f33838f3c90c79.tar.xz
zen-4558d1f477830ce52054669ab8f33838f3c90c79.zip
Apple Clang does not implement std::jthread
-rw-r--r--zenstore/gc.cpp4
-rw-r--r--zenstore/include/zenstore/gc.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index d23e0c466..92942b09f 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -393,7 +393,7 @@ GcScheduler::Initialize(const GcSchedulerConfig& Config)
}
m_NextGcTime = NextGcTime(m_LastGcTime);
- m_GcThread = std::jthread(&GcScheduler::SchedulerThread, this);
+ m_GcThread = std::thread(&GcScheduler::SchedulerThread, this);
}
void
@@ -403,6 +403,8 @@ GcScheduler::Shutdown()
{
m_Status = static_cast<uint32_t>(GcSchedulerStatus::kStopped);
m_GcSignal.notify_one();
+
+ m_GcThread.join();
}
}
diff --git a/zenstore/include/zenstore/gc.h b/zenstore/include/zenstore/gc.h
index 1540b66c2..b8ba338f0 100644
--- a/zenstore/include/zenstore/gc.h
+++ b/zenstore/include/zenstore/gc.h
@@ -204,7 +204,7 @@ private:
GcClock::TimePoint m_LastGcTime{};
GcClock::TimePoint m_NextGcTime{};
std::atomic_uint32_t m_Status{};
- std::jthread m_GcThread;
+ std::thread m_GcThread;
std::mutex m_GcMutex;
std::condition_variable m_GcSignal;
std::optional<TriggerParams> m_TriggerParams;