#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/BoostThreadWorker.hpp>
|
| void | run () |
| bool | join (int timeout_ms=0) |
◆ Slic3r::GUI::BoostThreadWorker::JobEntry
| struct Slic3r::GUI::BoostThreadWorker::JobEntry |
| Class Members |
|
bool |
canceled = false |
|
|
exception_ptr |
eptr = nullptr |
|
|
shared_ptr< Job > |
job |
|
◆ Slic3r::GUI::BoostThreadWorker::StatusInfo
| struct Slic3r::GUI::BoostThreadWorker::StatusInfo |
| Class Members |
|
string |
msg |
|
|
int |
status |
|
◆ Slic3r::GUI::BoostThreadWorker::MainThreadCallData
| struct Slic3r::GUI::BoostThreadWorker::MainThreadCallData |
| Class Members |
|
function< void()> |
fn |
|
|
promise< void > |
promise |
|
◆ Slic3r::GUI::BoostThreadWorker::EmptyMessage
| struct Slic3r::GUI::BoostThreadWorker::EmptyMessage |
◆ JobQueue
◆ MessageQueue
◆ BoostThreadWorker() [1/5]
| Slic3r::GUI::BoostThreadWorker::BoostThreadWorker |
( |
std::shared_ptr< ProgressIndicator > | pri, |
|
|
boost::thread::attributes & | attr, |
|
|
const char * | name = "" ) |
|
explicit |
94{
97
99
100 std::string nm{name};
102}
std::shared_ptr< ProgressIndicator > m_progress
Definition BoostThreadWorker.hpp:82
std::string m_name
Definition BoostThreadWorker.hpp:85
void run()
Definition BoostThreadWorker.cpp:50
void cancel() override
Definition BoostThreadWorker.hpp:137
boost::thread m_thread
Definition BoostThreadWorker.hpp:80
boost::thread create_thread(boost::thread::attributes &attrs, Fn &&fn)
Definition Thread.hpp:48
bool set_thread_name(std::thread &thread, const char *thread_name)
Definition Thread.cpp:175
References Slic3r::create_thread(), m_name, m_progress, m_thread, run(), and Slic3r::set_thread_name().
Referenced by BoostThreadWorker(), BoostThreadWorker(), BoostThreadWorker(), BoostThreadWorker(), Slic3r::GUI::BoostThreadWorker::WorkerMessage::deliver(), operator=(), and operator=().
◆ BoostThreadWorker() [2/5]
| Slic3r::GUI::BoostThreadWorker::BoostThreadWorker |
( |
std::shared_ptr< ProgressIndicator > | pri, |
|
|
boost::thread::attributes && | attr, |
|
|
const char * | name = "" ) |
|
inlineexplicit |
109 {}
BoostThreadWorker(std::shared_ptr< ProgressIndicator > pri, boost::thread::attributes &attr, const char *name="")
Definition BoostThreadWorker.cpp:90
References BoostThreadWorker().
◆ BoostThreadWorker() [3/5]
| Slic3r::GUI::BoostThreadWorker::BoostThreadWorker |
( |
std::shared_ptr< ProgressIndicator > | pri, |
|
|
const char * | name = "" ) |
|
inlineexplicit |
◆ ~BoostThreadWorker()
| Slic3r::GUI::BoostThreadWorker::~BoostThreadWorker |
( |
| ) |
|
107{
108 bool joined = false;
109 try {
114 } catch(...) {}
115
116 if (!joined)
117 BOOST_LOG_TRIVIAL(error)
118 <<
"Could not join worker thread '" <<
m_name <<
"'";
119}
bool join(int timeout_ms=0)
Definition BoostThreadWorker.cpp:121
bool wait_for_idle(unsigned timeout_ms=0) override
Definition BoostThreadWorker.cpp:170
JobQueue m_input_queue
Definition BoostThreadWorker.hpp:83
void cancel_all() override
Definition BoostThreadWorker.hpp:138
Definition BoostThreadWorker.hpp:37
constexpr int ABORT_WAIT_MAX_MS
Definition BoostThreadWorker.cpp:104
References Slic3r::GUI::ABORT_WAIT_MAX_MS, cancel_all(), join(), m_input_queue, m_name, and wait_for_idle().
◆ BoostThreadWorker() [4/5]
| Slic3r::GUI::BoostThreadWorker::BoostThreadWorker |
( |
const BoostThreadWorker & | | ) |
|
|
delete |
◆ BoostThreadWorker() [5/5]
| Slic3r::GUI::BoostThreadWorker::BoostThreadWorker |
( |
BoostThreadWorker && | | ) |
|
|
delete |
◆ call_on_main_thread()
| std::future< void > Slic3r::GUI::BoostThreadWorker::call_on_main_thread |
( |
std::function< void()> | fn | ) |
|
|
overrideprotectedvirtual |
◆ cancel()
| void Slic3r::GUI::BoostThreadWorker::cancel |
( |
| ) |
|
|
inlineoverridevirtual |
◆ cancel_all()
| void Slic3r::GUI::BoostThreadWorker::cancel_all |
( |
| ) |
|
|
inlineoverridevirtual |
◆ clear_percent()
| void Slic3r::GUI::BoostThreadWorker::clear_percent |
( |
| ) |
|
|
inlineoverridevirtual |
◆ get_pri() [1/2]
◆ get_pri() [2/2]
◆ is_idle()
| bool Slic3r::GUI::BoostThreadWorker::is_idle |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ join()
| bool Slic3r::GUI::BoostThreadWorker::join |
( |
int | timeout_ms = 0 | ) |
|
|
private |
122{
124 return true;
125
126 if (timeout_ms <= 0) {
128 }
129 else if (
m_thread.try_join_for(boost::chrono::milliseconds(timeout_ms))) {
130 return true;
131 }
132 else
133 return false;
134
135 return true;
136}
References m_thread.
Referenced by ~BoostThreadWorker().
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ process_events()
| void Slic3r::GUI::BoostThreadWorker::process_events |
( |
| ) |
|
|
overridevirtual |
◆ push()
| bool Slic3r::GUI::BoostThreadWorker::push |
( |
std::shared_ptr< Job > | job | ) |
|
|
overridevirtual |
◆ run()
| void Slic3r::GUI::BoostThreadWorker::run |
( |
| ) |
|
|
private |
◆ show_error_info()
| void Slic3r::GUI::BoostThreadWorker::show_error_info |
( |
const std::string & | msg, |
|
|
int | code, |
|
|
const std::string & | description, |
|
|
const std::string & | extra ) |
|
inlineoverridevirtual |
◆ update_status()
| void Slic3r::GUI::BoostThreadWorker::update_status |
( |
int | st, |
|
|
const std::string & | msg = "" ) |
|
overrideprotectedvirtual |
◆ wait_for_current_job()
| bool Slic3r::GUI::BoostThreadWorker::wait_for_current_job |
( |
unsigned | timeout_ms = 0 | ) |
|
|
overridevirtual |
Implements Slic3r::GUI::Worker.
146{
147 bool ret = true;
148
150 bool was_finish = false;
151 bool timeout_reached = false;
152 while (!timeout_reached && !was_finish) {
153 timeout_reached =
155 [this, &was_finish](
157 msg.deliver(*this);
158 if (msg.get_type() ==
160 was_finish = true;
161 });
162 }
163
164 ret = !timeout_reached;
165 }
166
167 return ret;
168}
@ Finalize
Definition BoostThreadWorker.hpp:59
bool is_idle() const override
Definition BoostThreadWorker.hpp:125
References Slic3r::GUI::BoostThreadWorker::WorkerMessage::Finalize, is_idle(), and m_output_queue.
◆ wait_for_idle()
| bool Slic3r::GUI::BoostThreadWorker::wait_for_idle |
( |
unsigned | timeout_ms = 0 | ) |
|
|
overridevirtual |
◆ was_canceled()
| bool Slic3r::GUI::BoostThreadWorker::was_canceled |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ m_canceled
| std::atomic<bool> Slic3r::GUI::BoostThreadWorker::m_canceled {false} |
|
private |
◆ m_input_queue
| JobQueue Slic3r::GUI::BoostThreadWorker::m_input_queue |
|
private |
◆ m_name
| std::string Slic3r::GUI::BoostThreadWorker::m_name |
|
private |
◆ m_output_queue
◆ m_progress
◆ m_running
| std::atomic<bool> Slic3r::GUI::BoostThreadWorker::m_running {false} |
|
private |
◆ m_thread
| boost::thread Slic3r::GUI::BoostThreadWorker::m_thread |
|
private |
The documentation for this class was generated from the following files: