Revert "move libthread to libstb-hal"

This reverts commit d5cea508e0.


Origin commit data
------------------
Branch: master
Commit: 6b8b8cd551
Author: max_10 <max_10@gmx.de>
Date: 2018-09-20 (Thu, 20 Sep 2018)



------------------
This commit was generated by Migit
This commit is contained in:
max_10
2018-09-20 17:42:13 +02:00
parent 9a0a03c733
commit 4cabdf7d12
23 changed files with 85 additions and 272 deletions

View File

@@ -0,0 +1,34 @@
#include "thread_abstraction.h"
SimpleThread::SimpleThread() :
mIsRunning(false),
mThread()
{
}
SimpleThread::~SimpleThread()
{
// if thread is still running on object destruction, cancel thread the hard way:
if (mIsRunning)
{
pthread_cancel(mThread);
}
}
void SimpleThread::startThread()
{
mIsRunning = true;
pthread_create(&mThread, 0, &SimpleThread::runThread, this);
}
void SimpleThread::joinThread()
{
pthread_join(mThread, 0);
mIsRunning = false;
}
void* SimpleThread::runThread(void* ptr)
{
static_cast<SimpleThread*>(ptr)->run();
return 0;
}