123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include "stdafx.h"
- #include "CThread.h"
- CThread::CThread()
- {
- }
- CThread::~CThread()
- {
- if (!this->isInterrupted())
- {
- this->interrupt();
- }
- if (this->th.joinable()) {
- this->th.join();
- }
- }
- void CThread::start()
- {
- std::thread thr(std::bind(&CThread::run, this));
- this->th = std::move(thr);
- }
- std::thread::id CThread::getId()
- {
- return this->th.get_id();
- }
- void CThread::interrupt()
- {
- this->isInterript;
- }
- bool CThread::isInterrupted()
- {
- return false;
- }
- void CThread::join()
- {
- this->th.join();
- }
- void CThread::run()
- {
- }
|