From 373fdec6d2f2f9372b42c19d16b81aef7a9d7718 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 12 Apr 2025 16:22:37 -0400 Subject: [PATCH] silly --- CMakeLists.txt | 2 +- src/sync.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26bcd99..dea35c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ macro(compile_options target_name) sanitizers(${target_name}) endmacro() -project(blt-gp VERSION 0.5.1) +project(blt-gp VERSION 0.5.2) include(CTest) diff --git a/src/sync.cpp b/src/sync.cpp index 62a78de..40f8839 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -57,12 +57,13 @@ namespace blt::gp BLT_WARN("Tried to remove sync from global sync state, but no thread was running"); return; } - std::scoped_lock lock(mutex); + std::unique_lock lock(mutex); const auto iter = std::find(syncs.begin(), syncs.end(), sync); std::iter_swap(iter, syncs.end() - 1); syncs.pop_back(); if (syncs.empty()) { + lock.unlock(); should_run = false; condition_variable.notify_all(); thread->join(); @@ -83,8 +84,12 @@ namespace blt::gp get_state().add(this); } - void sync_t::trigger(u64 current_time) + void sync_t::trigger(const u64 current_time) { + if ((m_timer_seconds && (current_time % *m_timer_seconds == 0)) || (m_generations && (current_time % *m_generations == 0))) + { + + } } sync_t::~sync_t()