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) <noreply@anthropic.com>
This commit is contained in:
Antonio S. Musumeci 2026-04-10 13:42:49 -04:00
parent 65e136c667
commit 0a0c82c224

View file

@ -173,6 +173,9 @@ private:
std::atomic<std::uint64_t> _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;