MySQL 8.0.40
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
os0thread.h File Reference

The interface to the operating system process and thread control primitives. More...

#include <atomic>
#include <cstring>
#include <functional>
#include <future>
#include <sstream>
#include <thread>
#include "ut0dbg.h"
#include "ut0math.h"

Go to the source code of this file.

Classes

class  IB_thread
 
class  Atomic_xor_of_things< T_thing, T_digit >
 A class to allow any trivially copyable object to be XOR'ed. More...
 

Namespaces

namespace  ut
 This file contains a set of libraries providing overloads for regular dynamic allocation routines which allow for opt-in memory instrumentation through performance schema memory engine (PFS).
 

Typedefs

using os_thread_id_t = std::thread::native_handle_type
 Operating system thread native handle. More...
 
using Xor_digit_for_thread_id = std::conditional< sizeof(std::thread::id) >=sizeof(uint64_t), uint64_t, uint32_t >::type
 A type for std::thread::id digit to store XOR efficiently. More...
 
using Atomic_xor_of_thread_id = Atomic_xor_of_things< std::thread::id, Xor_digit_for_thread_id >
 A type to store XORed objects of type std::thread::id. More...
 

Functions

std::string to_string (std::thread::id thread_id, bool hex_value=false)
 Returns the string representation of the thread ID supplied. More...
 

Variables

const thread_local size_t ut::this_thread_hash
 The hash value of the current thread's id. More...
 

Detailed Description

The interface to the operating system process and thread control primitives.

Created 9/8/1995 Heikki Tuuri

Typedef Documentation

◆ Atomic_xor_of_thread_id

A type to store XORed objects of type std::thread::id.

◆ os_thread_id_t

using os_thread_id_t = std::thread::native_handle_type

Operating system thread native handle.

◆ Xor_digit_for_thread_id

using Xor_digit_for_thread_id = std::conditional<sizeof(std::thread::id) >= sizeof(uint64_t), uint64_t, uint32_t>::type

A type for std::thread::id digit to store XOR efficiently.

This will make the compiler to optimize the operations hopefully to single instruction.

Function Documentation

◆ to_string()

std::string to_string ( std::thread::id  thread_id,
bool  hex_value = false 
)

Returns the string representation of the thread ID supplied.

It uses the only standard-compliant way of printing the thread ID.

Parameters
thread_idThe thread ID to convert to string.
hex_valueIf true, the conversion will be asked to output in hexadecimal format. The support for it is OS-implementation-dependent and may be ignored.