MySQL 8.0.40
Source Code Documentation
ThreadAffinity Class Reference

manage thread affinity. More...

#include <thread_affinity.h>

Public Types

using native_handle_type = pthread_t
 

Public Member Functions

 ThreadAffinity (native_handle_type thread_id) noexcept
 
stdx::expected< std::bitset< max_cpus >, std::error_code > affinity () const noexcept
 
stdx::expected< void, std::error_code > affinity (std::bitset< ThreadAffinity::max_cpus > cpus) const noexcept
 

Static Public Member Functions

static native_handle_type current_thread_handle () noexcept
 

Static Public Attributes

static constexpr const int max_cpus = 1024
 

Private Attributes

native_handle_type thread_id_
 

Detailed Description

manage thread affinity.

Member Typedef Documentation

◆ native_handle_type

Constructor & Destructor Documentation

◆ ThreadAffinity()

ThreadAffinity::ThreadAffinity ( native_handle_type  thread_id)
inlinenoexcept

Member Function Documentation

◆ affinity() [1/2]

stdx::expected< std::bitset< ThreadAffinity::max_cpus >, std::error_code > ThreadAffinity::affinity ( ) const
noexcept

◆ affinity() [2/2]

stdx::expected< void, std::error_code > ThreadAffinity::affinity ( std::bitset< ThreadAffinity::max_cpus cpus) const
noexcept

◆ current_thread_handle()

ThreadAffinity::native_handle_type ThreadAffinity::current_thread_handle ( )
staticnoexcept

Member Data Documentation

◆ max_cpus

constexpr const int ThreadAffinity::max_cpus = 1024
staticconstexpr

◆ thread_id_

native_handle_type ThreadAffinity::thread_id_
private

The documentation for this class was generated from the following files: