From 0a0c82c22459990da4baebb48303971705f1d50f Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Fri, 10 Apr 2026 13:42:49 -0400 Subject: [PATCH] Document thread-safety of _scaling_config and _autoscale_enabled These fields are written once in the constructor before any worker or monitor threads are spawned, and are read-only thereafter. Add an explicit comment noting the write-once-then-read-only invariant so future maintainers know that making them mutable would require synchronization. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index 0d07060d..cbd77fb3 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -173,6 +173,9 @@ private: std::atomic _tasks_completed{0}; // Auto-scaling state + // _autoscale_enabled and _scaling_config are set once in the + // constructor before any threads start and are thereafter read-only. + // No synchronization is needed for their accesses. bool _autoscale_enabled; ScalingConfig _scaling_config; pthread_t _monitor_thread;