Skeleton of application, at least compiles
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user