![]() |
MySQL
8.0.23
Source Code Documentation
|
#include <atomic>
#include <future>
#include <thread>
Go to the source code of this file.
Classes | |
class | IB_thread |
Macros | |
#define | os_thread_handle() ((uint64_t)(os_thread_get_curr_id())) |
Return the thread handle. More... | |
#define | os_thread_eq(lhs, rhs) ((lhs) == (rhs)) |
Compares two thread ids for equality. More... | |
#define | os_thread_yield() |
Advises the OS to give up remainder of the thread's time slice. More... | |
#define | os_thread_sleep(usecs) |
The thread sleeps at least the time given in microseconds. More... | |
Typedefs | |
using | os_thread_id_t = std::thread::native_handle_type |
Operating system thread native handle. More... | |
Functions | |
os_thread_id_t | os_thread_get_curr_id () |
Returns the thread identifier of current thread. More... | |
bool | os_thread_set_priority (int priority) |
Set priority for current thread. More... | |
void | os_thread_set_priority (int priority, const char *thread_name) |
Set priority for current thread. More... | |
The interface to the operating system process and thread control primitives
Created 9/8/1995 Heikki Tuuri
#define os_thread_eq | ( | lhs, | |
rhs | |||
) | ((lhs) == (rhs)) |
Compares two thread ids for equality.
[in] | lhs | OS thread or thread id |
[in] | rhs | OS thread or thread id return true if equal |
#define os_thread_handle | ( | ) | ((uint64_t)(os_thread_get_curr_id())) |
Return the thread handle.
The purpose of this function is to cast the native handle to an integer type for consistency
#define os_thread_sleep | ( | usecs | ) |
The thread sleeps at least the time given in microseconds.
[in] | usecs | time in microseconds |
#define os_thread_yield | ( | ) |
Advises the OS to give up remainder of the thread's time slice.
using os_thread_id_t = std::thread::native_handle_type |
Operating system thread native handle.
os_thread_id_t os_thread_get_curr_id | ( | ) |
Returns the thread identifier of current thread.
Currently the thread identifier in Unix is the thread handle itself.
bool os_thread_set_priority | ( | int | priority | ) |
Set priority for current thread.
[in] | priority | priority intended to set |
true | set as intended |
false | got different priority after attempt to set |
void os_thread_set_priority | ( | int | priority, |
const char * | thread_name | ||
) |
Set priority for current thread.
[in] | priority | priority intended to set |
[in] | thread_name | name of thread, used for log message |