MySQL 8.3.0
Source Code Documentation
my_thread.cc File Reference
#include "my_config.h"
#include <cstring>
#include <pthread.h>
#include "my_thread.h"
#include "mysql/components/services/bits/my_thread_bits.h"

Macros

#define _GNU_SOURCE
 
#define SETNAME_MAX_LENGTH   16
 Maximum name length used for my_thread_self_setname(), including the terminating NUL character. More...
 

Functions

int my_thread_create (my_thread_handle *thread, const my_thread_attr_t *attr, my_start_routine func, void *arg)
 
int my_thread_join (my_thread_handle *thread, void **value_ptr)
 
int my_thread_cancel (my_thread_handle *thread)
 
void my_thread_exit (void *value_ptr)
 
void my_thread_self_setname (const char *name)
 Sets the name of the thread for system and debugger, if possible. More...
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ SETNAME_MAX_LENGTH

#define SETNAME_MAX_LENGTH   16

Maximum name length used for my_thread_self_setname(), including the terminating NUL character.

Linux pthread_setname_np(3) is restricted to 15+1 chars, so we use the same limit on all platforms.

Function Documentation

◆ my_thread_cancel()

int my_thread_cancel ( my_thread_handle thread)

◆ my_thread_create()

int my_thread_create ( my_thread_handle thread,
const my_thread_attr_t attr,
my_start_routine  func,
void *  arg 
)

◆ my_thread_exit()

void my_thread_exit ( void *  value_ptr)

◆ my_thread_join()

int my_thread_join ( my_thread_handle thread,
void **  value_ptr 
)

◆ my_thread_self_setname()

void my_thread_self_setname ( const char *  name)

Sets the name of the thread for system and debugger, if possible.

Parameters
nameName to set, must be shorter than SETNAME_MAX_LENGTH, including NULL character.