2021-08-06 22:11:32 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <thread>
|
|
|
|
|
|
2022-11-08 00:14:27 +01:00
|
|
|
enum thread_priority_t
|
|
|
|
|
{
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
PRIORITY_LOWEST = -2,
|
|
|
|
|
PRIORITY_LOW = -1,
|
|
|
|
|
PRIORITY_NORMAL = 0,
|
|
|
|
|
PRIORITY_HIGH = 1,
|
|
|
|
|
PRIORITY_HIGHEST = 2,
|
|
|
|
|
#else
|
|
|
|
|
PRIORITY_LOWEST = 1,
|
|
|
|
|
PRIORITY_LOW = 24,
|
|
|
|
|
PRIORITY_NORMAL = 50,
|
|
|
|
|
PRIORITY_HIGH = 74,
|
|
|
|
|
PRIORITY_HIGHEST = 99,
|
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-08 15:30:26 +02:00
|
|
|
void setThreadPriority(std::thread &th, thread_priority_t priority);
|
2024-01-23 22:04:23 +01:00
|
|
|
void setLowestThreadPriority(std::thread &th);
|
|
|
|
|
void setLowestThreadPriority();
|