Files
tsMuxer/libmediation/system/terminatablethread.cpp
Daniel Kamil Kozar 451ec61a50 Introduce a uniform formatting style (#131)
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.
2020-01-14 21:56:44 +01:00

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(); });
}