mirror of
https://github.com/oatpp/oatpp.git
synced 2025-03-31 18:30:22 +08:00
parent
8451ee724a
commit
9c4bbad4ec
@ -66,16 +66,22 @@ void Executor::SubmissionProcessor::pushOneTask(CoroutineHandle* task) {
|
||||
}
|
||||
|
||||
void Executor::SubmissionProcessor::stop() {
|
||||
m_isRunning = false;
|
||||
m_processor.stop();
|
||||
if (m_isRunning) {
|
||||
m_isRunning = false;
|
||||
m_processor.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void Executor::SubmissionProcessor::join() {
|
||||
m_thread.join();
|
||||
if (m_thread.joinable()) {
|
||||
m_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
void Executor::SubmissionProcessor::detach() {
|
||||
m_thread.detach();
|
||||
if (m_thread.joinable()) {
|
||||
m_thread.detach();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -54,6 +54,10 @@ private:
|
||||
std::thread m_thread;
|
||||
public:
|
||||
SubmissionProcessor();
|
||||
~SubmissionProcessor() override {
|
||||
stop();
|
||||
join();
|
||||
}
|
||||
public:
|
||||
|
||||
template<typename CoroutineType, typename ... Args>
|
||||
|
Loading…
x
Reference in New Issue
Block a user