-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththreads.h
More file actions
50 lines (41 loc) · 1.29 KB
/
threads.h
File metadata and controls
50 lines (41 loc) · 1.29 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include "config.h"
#if !RPP_BARE_METAL
#include "strview.h"
#endif // !RPP_BARE_METAL
namespace rpp
{
//////////////////////////////////////////////////////////////////////////////////////////
#if !RPP_BARE_METAL
/**
* @brief Sets the debug name for this thread
* @warning Linux pthreads only supports max length 15 characters for thread names
*/
RPPAPI void set_this_thread_name(rpp::strview name) noexcept;
/**
* @returns The debug name of this thread
*/
RPPAPI std::string get_this_thread_name() noexcept;
/**
* @returns The debug name of the thread with the given ID (@see rpp::get_thread_id())
*/
RPPAPI std::string get_thread_name(uint64 thread_id) noexcept;
/**
* @returns Current thread ID as a 64-bit integer
*/
RPPAPI uint64 get_thread_id() noexcept;
/**
* @returns Current process ID as a 32-bit integer
*/
RPPAPI uint32 get_process_id() noexcept;
/**
* @returns Number of physicals cores on the system
*/
RPPAPI int num_physical_cores() noexcept;
#endif // !RPP_BARE_METAL
/**
* @brief Yields execution to another thread
*/
RPPAPI void yield() noexcept;
//////////////////////////////////////////////////////////////////////////////////////////
}