34 #include "../Exception.h" 35 #include "../Output/Output.h" 53 void setThreadPriority(pthread_t thread, int32_t priority, int32_t policy = SCHED_FIFO);
55 template<
typename Function,
typename... Args>
56 bool start(std::thread& thread,
bool highPriority, Function&&
function, Args&&... args)
60 thread = std::thread(
function, args...);
65 template<
typename Function,
typename... Args>
66 bool start(std::thread& thread,
bool highPriority, int32_t priority, int32_t policy, Function&&
function, Args&&... args)
70 thread = std::thread(
function, args...);
76 void join(std::thread& thread);
bool checkThreadCount(bool highPriority)
Definition: ThreadManager.cpp:107
uint32_t getMaxRegisteredThreadCount()
Definition: ThreadManager.cpp:85
Definition: ThreadManager.h:44
This is the base library main class.
Definition: BaseLib.h:95
void registerThread()
Definition: ThreadManager.cpp:193
uint32_t getMaxThreadCount()
Definition: ThreadManager.cpp:95
SharedObjects * _bl
Definition: ThreadManager.h:86
Definition: BaseLib.cpp:34
bool start(std::thread &thread, bool highPriority, int32_t priority, int32_t policy, Function &&function, Args &&... args)
Definition: ThreadManager.h:66
ThreadManager()
Definition: ThreadManager.cpp:48
uint32_t _maxThreadCount
Definition: ThreadManager.h:89
static int32_t getThreadPolicyFromString(std::string policy)
Definition: ThreadManager.cpp:117
void testMaxThreadCount()
Definition: ThreadManager.cpp:62
void unregisterThread()
Definition: ThreadManager.cpp:200
void init(BaseLib::SharedObjects *baseLib, bool testMaxThreadCount)
Definition: ThreadManager.cpp:56
void join(std::thread &thread)
Definition: ThreadManager.cpp:184
PVariable value
Definition: UiElements.h:217
volatile int32_t _currentThreadCount
Definition: ThreadManager.h:90
void setMaxThreadCount(uint32_t value)
Definition: ThreadManager.cpp:90
int32_t getCurrentThreadCount()
Definition: ThreadManager.cpp:100
bool start(std::thread &thread, bool highPriority, Function &&function, Args &&... args)
Definition: ThreadManager.h:56
std::mutex _threadCountMutex
Definition: ThreadManager.h:87
static int32_t parseThreadPriority(int32_t priority, int32_t policy)
Definition: ThreadManager.cpp:132
virtual ~ThreadManager()
Definition: ThreadManager.cpp:52
uint32_t _maxRegisteredThreadCount
Definition: ThreadManager.h:88
void setThreadPriority(pthread_t thread, int32_t priority, int32_t policy=SCHED_FIFO)
Definition: ThreadManager.cpp:143