mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-05-17 11:08:53 +08:00
24 lines
382 B
C++
24 lines
382 B
C++
#include "thread_base.h"
|
|
|
|
#include "log.h"
|
|
|
|
ThreadBase::ThreadBase() {}
|
|
|
|
ThreadBase::~ThreadBase() {}
|
|
|
|
void ThreadBase::StartThread() {
|
|
if (!thread_) {
|
|
thread_ = std::make_unique<std::thread>(&ThreadBase::Run, this);
|
|
}
|
|
}
|
|
|
|
void ThreadBase::StopThread() {
|
|
if (thread_ && thread_->joinable()) {
|
|
thread_->join();
|
|
}
|
|
}
|
|
|
|
void ThreadBase::Run() {
|
|
while (Process()) {
|
|
}
|
|
} |