Skeleton of application, at least compiles

This commit is contained in:
ftc
2020-11-24 22:48:54 +03:00
parent 988adcec4a
commit bd5a629fde
24 changed files with 1788 additions and 3 deletions
+27
View File
@@ -0,0 +1,27 @@
#ifndef CORE_THREAD_HEADER_FILE_INCLUDED
#define CORE_THREAD_HEADER_FILE_INCLUDED
#include <pthread.h>
namespace ftc
{
class Thread
{
private:
pthread_t thread;
bool is_running = false;
bool delete_after_finish = false;
static void* DoRun(void *arg);
protected:
// Основная функция потока, переопределите в дочерних классах
virtual void Run();
public:
bool IsRunning() { return is_running; }
virtual ~Thread() {}
bool Start();
// Запускает поток, удаляя его после завершения
static void Perform(Thread *work);
};
}
#endif