MySQL  8.0.19
Source Code Documentation
os0thread.cc File Reference
#include "univ.i"
#include <atomic>
#include <thread>
#include "ut0ut.h"

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...
 

Variables

ulint srv_max_n_threads = 0
 We are prepared for a situation that we have this many threads waiting for a semaphore inside InnoDB. More...
 
std::atomic_int os_thread_count
 Number of threads active. More...
 

Detailed Description

The interface to the operating system thread control primitives

Created 9/8/1995 Heikki Tuuri

Function Documentation

◆ os_thread_get_curr_id()

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.

Returns
current thread native handle

◆ os_thread_set_priority() [1/2]

bool os_thread_set_priority ( int  priority)

Set priority for current thread.

Parameters
[in]prioritypriority intended to set
Return values
trueset as intended
falsegot different priority after attempt to set

◆ os_thread_set_priority() [2/2]

void os_thread_set_priority ( int  priority,
const char *  thread_name 
)

Set priority for current thread.

Parameters
[in]prioritypriority intended to set
[in]thread_namename of thread, used for log message

Variable Documentation

◆ os_thread_count

std::atomic_int os_thread_count

Number of threads active.

◆ srv_max_n_threads

ulint srv_max_n_threads = 0

We are prepared for a situation that we have this many threads waiting for a semaphore inside InnoDB.

Maximum number of threads inside InnoDB.

innodb_init_params() sets the value.