Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/src/libslic3r/utils.cpp')
-rw-r--r--xs/src/libslic3r/utils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp
index 55164bbdd..4ca4f69fd 100644
--- a/xs/src/libslic3r/utils.cpp
+++ b/xs/src/libslic3r/utils.cpp
@@ -24,6 +24,8 @@
#include <boost/nowide/integration/filesystem.hpp>
#include <boost/nowide/convert.hpp>
+#include <tbb/task_scheduler_init.h>
+
namespace Slic3r {
static boost::log::trivial::severity_level logSeverity = boost::log::trivial::error;
@@ -82,6 +84,14 @@ void trace(unsigned int level, const char *message)
(::boost::log::keywords::severity = severity)) << message;
}
+void disable_multi_threading()
+{
+ // Disable parallelization so the Shiny profiler works
+ static tbb::task_scheduler_init *tbb_init = nullptr;
+ if (tbb_init == nullptr)
+ tbb_init = new tbb::task_scheduler_init(1);
+}
+
static std::string g_var_dir;
void set_var_dir(const std::string &dir)