mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 15:06:33 -05:00
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:
parent
65e136c667
commit
0a0c82c224
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue