fix: prevent static initialization deadlock in thread_data (#2474)
* fix: prevent static initialization deadlock in thread_data * update comment
This commit is contained in:
1 parent
1d5a6e9bfe
commit
9e4d1c31c7
1 file changed
+2
-8
@@ -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.
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user