From 97990401e2332276b5397060a3ccaf19f07fb999 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Sat, 17 Aug 2024 19:55:55 -0400 Subject: [PATCH] atomic use count --- CMakeLists.txt | 2 +- include/blt/std/thread.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c51a842..3188a72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.18.34) +set(BLT_VERSION 0.18.35) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/std/thread.h b/include/blt/std/thread.h index 3720490..b759632 100644 --- a/include/blt/std/thread.h +++ b/include/blt/std/thread.h @@ -94,7 +94,7 @@ namespace blt private: blt::size_t thread_count; blt::size_t threads_waiting; - blt::size_t use_count; + std::atomic_uint64_t use_count; std::optional> exit_cond; std::mutex count_mutex; std::condition_variable cv;