update to latest version

This commit is contained in:
QIDI TECH
2023-06-27 11:07:34 +08:00
parent afe5c54367
commit dd0d4c8c4a
80 changed files with 1931 additions and 599 deletions

View File

@@ -211,6 +211,12 @@ bool is_main_thread_active()
return get_main_thread_id() == boost::this_thread::get_id();
}
static thread_local ThreadData s_thread_data;
ThreadData& thread_data()
{
return s_thread_data;
}
// Spawn (n - 1) worker threads on Intel TBB thread pool and name them by an index and a system thread ID.
// Also it sets locale of the worker threads to "C" for the G-code generator to produce "." as a decimal separator.
void name_tbb_thread_pool_threads_set_locale()
@@ -274,16 +280,16 @@ void set_current_thread_qos()
#endif // __APPLE__
}
void TBBLocalesSetter::on_scheduler_entry(bool is_worker)
void ThreadData::tbb_worker_thread_set_c_locales()
{
// static std::atomic<int> cnt = 0;
// std::cout << "TBBLocalesSetter Entering " << cnt ++ << " ID " << std::this_thread::get_id() << "\n";
if (bool& is_locales_sets = m_is_locales_sets.local(); !is_locales_sets) {
if (! m_tbb_worker_thread_c_locales_set) {
// Set locales of the worker thread to "C".
set_c_locales();
// OSX specific: Elevate QOS on Apple Silicon.
set_current_thread_qos();
is_locales_sets = true;
m_tbb_worker_thread_c_locales_set = true;
}
}