moved non public headers

This commit is contained in:
Erik Frojdh
2020-02-03 14:38:24 +01:00
parent 6cc13f9dc1
commit 254e8f85d8
20 changed files with 12 additions and 5 deletions

View File

@ -0,0 +1,47 @@
#pragma once
/************************************************
* @file ThreadObject.h
* @short creates/destroys a thread
***********************************************/
/**
*@short creates/destroys a thread
*/
#include "sls_detector_defs.h"
#include "logger.h"
#include <semaphore.h>
#include <string>
#include <atomic>
#include <future>
class ThreadObject : private virtual slsDetectorDefs {
public:
ThreadObject(int threadIndex, std::string threadType);
virtual ~ThreadObject();
virtual bool IsRunning() = 0;
void Continue();
void SetThreadPriority(int priority);
protected:
virtual void ThreadExecution() = 0;
private:
/**
* Thread called: An infinite while loop in which,
* semaphore starts executing its contents as long RunningMask is satisfied
* Then it exits the thread on its own if killThread is true
*/
void RunningThread();
protected:
int index{0};
std::string type;
std::atomic<bool> killThread{false};
std::unique_ptr<std::thread> threadObject;
sem_t semaphore;
};