mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
drop deprecated TBB components (#6590)
Quite some time ago, many of the TBB components were deprecated in favor of their near-equivalents in the STL or, in the case of task_scheduler_init, were broken up and reconstituted under a less ad-hoc logic. Every time a header file marked deprecated gets included, a rather loud warning is emitted, which leads to a complete TBB's domination over the stderr stream during build time, making it harder to notice _legitimate_ warnings. Instead of merely muting the output with TBB_SUPPRESS_DEPRECATED_MESSAGES, perform a genuine migration away from the deprecated components with the added benefit of achieving a source compatibility with oneTBB, the successor to TBB which has dropped the deprecated API for good. What got replaced for what? | Deprecated | Replacement | | ------------------------------------- | --------------------------------------------- | | `tbb::atomic` | `std::atomic` | | `tbb::mutex` | `std::mutex` | | `tbb::mutex::scoped_lock` | `std::scoped_lock<std::mutex>` | | `tbb::mutex::scoped_lock` (empty) | `std::unique_lock<std::mutex>` (deferred) | | `tbb::task_scheduler_init` | `tbb::global_control` | | `tbb::this_thread` | `std::this_thread` | Signed-off-by: Roman Beranek <roman.beranek@prusa3d.com>
This commit is contained in:
@@ -645,7 +645,7 @@ void BackgroundSlicingProcess::schedule_export(const std::string &path, bool exp
|
||||
return;
|
||||
|
||||
// Guard against entering the export step before changing the export path.
|
||||
tbb::mutex::scoped_lock lock(m_print->state_mutex());
|
||||
std::scoped_lock<std::mutex> lock(m_print->state_mutex());
|
||||
this->invalidate_step(bspsGCodeFinalize);
|
||||
m_export_path = path;
|
||||
m_export_path_on_removable_media = export_path_on_removable_media;
|
||||
@@ -658,7 +658,7 @@ void BackgroundSlicingProcess::schedule_upload(Slic3r::PrintHostJob upload_job)
|
||||
return;
|
||||
|
||||
// Guard against entering the export step before changing the export path.
|
||||
tbb::mutex::scoped_lock lock(m_print->state_mutex());
|
||||
std::scoped_lock<std::mutex> lock(m_print->state_mutex());
|
||||
this->invalidate_step(bspsGCodeFinalize);
|
||||
m_export_path.clear();
|
||||
m_upload_job = std::move(upload_job);
|
||||
@@ -671,7 +671,7 @@ void BackgroundSlicingProcess::reset_export()
|
||||
m_export_path.clear();
|
||||
m_export_path_on_removable_media = false;
|
||||
// invalidate_step expects the mutex to be locked.
|
||||
tbb::mutex::scoped_lock lock(m_print->state_mutex());
|
||||
std::scoped_lock<std::mutex> lock(m_print->state_mutex());
|
||||
this->invalidate_step(bspsGCodeFinalize);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user