fix: prevent static initialization deadlock in thread_data (#2474)

* fix: prevent static initialization deadlock in thread_data

* update comment
This commit is contained in:
habajpai-amd
2026-01-06 16:39:32 +05:30
committed by GitHub
vanhempi 1d5a6e9bfe
commit 9e4d1c31c7
@@ -71,14 +71,8 @@ struct base_thread_data
};
grow_functors().emplace_back(_func);
// Immediately sync this container to current peak_num_threads.
// This ensures containers instantiated after threads exceed
// max_supported_threads are properly sized.
auto _current_peak = get_current_peak_num_threads();
if(_current_peak > static_cast<int64_t>(max_supported_threads))
{
_func(_current_peak);
}
// NOTE: Do not call _func() here - causes recursive static initialization
// deadlock. Container resizing is handled via grow_functors() in thread_info.cpp.
}
};