Support for naming slicer own threads for debugging.

The following threads are named with this commit:
slic3r_main, slic3r_BackgroundSlicingProcess,
slic3r_tbbpool_xx_yy where xx is a one based index of the TTB thread
and yy is the platform thread ID.
This commit is contained in:
Vojtech Bubnik 2020-10-22 13:53:08 +02:00
parent 8d59abfdf8
commit 6531061d09
12 changed files with 219 additions and 38 deletions

View file

@ -23,6 +23,7 @@
#include "libslic3r/GCode/PreviewData.hpp"
#endif // !ENABLE_GCODE_VIEWER
#include "libslic3r/Format/SL1.hpp"
#include "libslic3r/Thread.hpp"
#include "libslic3r/libslic3r.h"
#include <cassert>
@ -36,7 +37,6 @@
#include "I18N.hpp"
#include "RemovableDriveManager.hpp"
#include "slic3r/Utils/Thread.hpp"
#include "slic3r/GUI/Plater.hpp"
namespace Slic3r {
@ -224,6 +224,9 @@ void BackgroundSlicingProcess::process_sla()
void BackgroundSlicingProcess::thread_proc()
{
set_current_thread_name("slic3r_BackgroundSlicingProcess");
name_tbb_thread_pool_threads();
assert(m_print != nullptr);
assert(m_print == m_fff_print || m_print == m_sla_print);
std::unique_lock<std::mutex> lck(m_mutex);