-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThread.hpp
More file actions
37 lines (25 loc) · 832 Bytes
/
Copy pathThread.hpp
File metadata and controls
37 lines (25 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#if !defined(ELUCIDATE__SYS__THREAD_HPP)
#define ELUCIDATE__SYS__THREAD_HPP
#include <optional>
#include <thread>
#include <sys/types.h>
namespace Elucidate::Sys {
class OSIndex;
/** @brief set CPU affinity of this thread to a single PU */
void setMyCPURange(OSIndex id);
/** @brief set CPU affinity of thread to a single PU */
void setCPURange(std::thread& t, OSIndex id,
std::optional< int > const& warnValue
= std::optional< int >());
/** @brief grab the POSIX thread id */
pthread_t getPThreadId();
/** @brief grab the linux thread id */
long getThreadId();
/** @brief set current thread to top priority */
void setMyHighPriority();
/** @brief set thread to top priority */
void setHighPriority(std::thread& t,
std::optional< int > const& warnValue
= std::optional< int >());
}
#endif