mirror of
https://github.com/justdan96/tsMuxer.git
synced 2026-10-21 14:52:04 +08:00
451ec61a50
The repository now contains a clang-format file which should be used when committing new code. Additionally, a new workflow job is added which checks the conformance of source files to the specified formatting rules. Fixes #47.
13 lines
363 B
C++
13 lines
363 B
C++
#include "terminatablethread.h"
|
|
|
|
#include <cassert>
|
|
|
|
TerminatableThread::~TerminatableThread() { join(); }
|
|
|
|
void TerminatableThread::run(TerminatableThread *const t)
|
|
{
|
|
assert(t->m_thread.get_id() == std::thread::id() &&
|
|
"TerminatableThread::run() called on an already running thread");
|
|
t->m_thread = std::thread([t]() { t->thread_main(); });
|
|
}
|