diff options
author | bubnikv <bubnikv@gmail.com> | 2018-09-17 16:12:13 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-09-17 16:12:13 +0300 |
commit | fe3b92870f217a3356094a0a6ad60b25ccf18996 (patch) | |
tree | dd9ebd271884eef3be0270cbb34809738950b390 /xs/src/libslic3r/utils.cpp | |
parent | d934b63424ab76ddcd8a87f272838df611dfcd0c (diff) |
Merged with dev
Diffstat (limited to 'xs/src/libslic3r/utils.cpp')
-rw-r--r-- | xs/src/libslic3r/utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp index 4c2d65605..46ee65a35 100644 --- a/xs/src/libslic3r/utils.cpp +++ b/xs/src/libslic3r/utils.cpp @@ -25,6 +25,8 @@ #include <boost/nowide/convert.hpp> #include <boost/nowide/cstdio.hpp> +#include <tbb/task_scheduler_init.h> + namespace Slic3r { static boost::log::trivial::severity_level logSeverity = boost::log::trivial::error; @@ -83,6 +85,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) |