MySQL 9.1.0
Source Code Documentation
|
Defines to make different thread packages compatible. More...
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
#include <mysql/components/services/bits/my_thread_bits.h>
#include "my_compiler.h"
#include "my_config.h"
#include "my_inttypes.h"
#include "my_macros.h"
Go to the source code of this file.
Macros | |
#define | ETIME ETIMEDOUT /* For FreeBSD */ |
#define | ETIMEDOUT 145 /* Win32 doesn't have this */ |
#define | DEFAULT_THREAD_STACK (1024UL * 1024UL) |
#define | MY_THREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE |
#define | MY_THREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED |
Typedefs | |
typedef void *(* | my_start_routine) (void *) |
Functions | |
static bool | is_timeout (int e) |
static my_thread_t | my_thread_self () |
static int | my_thread_equal (my_thread_t t1, my_thread_t t2) |
static int | my_thread_attr_init (my_thread_attr_t *attr) |
static int | my_thread_attr_destroy (my_thread_attr_t *attr) |
static int | my_thread_attr_setstacksize (my_thread_attr_t *attr, size_t stacksize) |
static int | my_thread_attr_setdetachstate (my_thread_attr_t *attr, int detachstate) |
static int | my_thread_attr_getstacksize (my_thread_attr_t *attr, size_t *stacksize) |
static void | my_thread_yield () |
bool | operator== (const my_thread_handle &a, const my_thread_handle &b) |
bool | operator!= (const my_thread_handle &a, const my_thread_handle &b) |
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... | |
bool | my_thread_global_init () |
initialize thread environment More... | |
void | my_thread_global_reinit () |
Re-initialize components initialized early with my_thread_global_init . More... | |
void | my_thread_global_end () |
bool | my_thread_init () |
Allocate thread specific memory for the thread, used by mysys and dbug. More... | |
void | my_thread_end () |
Deallocate memory used by the thread for book-keeping. More... | |
bool | my_thread_is_inited () |
Defines to make different thread packages compatible.
#define DEFAULT_THREAD_STACK (1024UL * 1024UL) |
#define ETIME ETIMEDOUT /* For FreeBSD */ |
#define ETIMEDOUT 145 /* Win32 doesn't have this */ |
#define MY_THREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED |
#define MY_THREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE |
typedef void *(* my_start_routine) (void *) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
int my_thread_cancel | ( | my_thread_handle * | thread | ) |
int my_thread_create | ( | my_thread_handle * | thread, |
const my_thread_attr_t * | attr, | ||
my_start_routine | func, | ||
void * | arg | ||
) |
void my_thread_end | ( | ) |
Deallocate memory used by the thread for book-keeping.
|
inlinestatic |
void my_thread_exit | ( | void * | value_ptr | ) |
void my_thread_global_end | ( | ) |
bool my_thread_global_init | ( | ) |
initialize thread environment
false | ok |
true | error |
void my_thread_global_reinit | ( | ) |
Re-initialize components initialized early with my_thread_global_init
.
Some mutexes were initialized before the instrumentation. Destroy + create them again, now that the instrumentation is in place. This is safe, since this function() is called before creating new threads, so the mutexes are not in use.
bool my_thread_init | ( | ) |
Allocate thread specific memory for the thread, used by mysys and dbug.
false | ok |
true | Fatal error; mysys/dbug functions can't be used |
bool my_thread_is_inited | ( | ) |
int my_thread_join | ( | my_thread_handle * | thread, |
void ** | value_ptr | ||
) |
|
inlinestatic |
void my_thread_self_setname | ( | const char * | name | ) |
Sets the name of the thread for system and debugger, if possible.
name | Name to set, must be shorter than SETNAME_MAX_LENGTH, including NULL character. |
|
inlinestatic |
|
inline |
|
inline |