From 9222a4ff628388ca611d80eaec73b6912a7d543a Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Thu, 9 Apr 2026 20:46:42 -0400 Subject: [PATCH] Move _tp_now_usecs into ThreadPool as private static _now_usecs The file-scope function _tp_now_usecs had a leading underscore followed by a lowercase letter, which is reserved at file scope by the C++ standard. Move it to a private static member function ThreadPool::_now_usecs where leading underscores on member names are permitted. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index abf317ee..2be12f56 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -89,6 +89,7 @@ private: void _remove_self(pthread_t t_); bool _try_remove_self_if_above(pthread_t t_, std::size_t min_count_); void _maybe_grow_on_pressure(); + static std::uint64_t _now_usecs(); static thread_local bool _tl_should_exit; @@ -179,10 +180,9 @@ private: inline thread_local bool ThreadPool::_tl_should_exit = false; -static inline std::uint64_t -_tp_now_usecs() +ThreadPool::_now_usecs() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC,&ts); @@ -515,7 +515,7 @@ ThreadPool::monitor_routine(void *arg_) if(direction > 0 && count < btp->_scaling_config.max_threads) { btp->add_thread(); - btp->_last_scale_time_usecs.store(_tp_now_usecs(), + btp->_last_scale_time_usecs.store(_now_usecs(), std::memory_order_relaxed); syslog(LOG_DEBUG, "threadpool (%s): hill-climb grow to %zu threads " @@ -528,7 +528,7 @@ ThreadPool::monitor_routine(void *arg_) else if(direction < 0 && count > btp->_scaling_config.min_threads) { btp->remove_thread(); - btp->_last_scale_time_usecs.store(_tp_now_usecs(), + btp->_last_scale_time_usecs.store(_now_usecs(), std::memory_order_relaxed); syslog(LOG_DEBUG, "threadpool (%s): hill-climb shrink to %zu threads " @@ -597,7 +597,7 @@ ThreadPool::_maybe_grow_on_pressure() if(!_autoscale_enabled) return; - std::uint64_t now = _tp_now_usecs(); + std::uint64_t now = _now_usecs(); std::uint64_t last = _last_scale_time_usecs.load(std::memory_order_relaxed); if((now - last) < (std::uint64_t)_scaling_config.cooldown_usecs)