MySQL 8.4.3
Source Code Documentation
my_thread_local.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MY_THREAD_LOCAL_INCLUDED
25#define MY_THREAD_LOCAL_INCLUDED
26
27/**
28 @file include/my_thread_local.h
29*/
30
31#include "my_inttypes.h"
32#include "my_macros.h"
33
35
36/**
37 Retrieve the MySQL thread-local storage variant of errno.
38*/
39int my_errno();
40
41/**
42 Set the MySQL thread-local storage variant of errno.
43*/
44void set_my_errno(int my_errno);
45
46#ifdef _WIN32
47/*
48 thr_winerr is used for returning the original OS error-code in Windows,
49 my_osmaperr() returns EINVAL for all unknown Windows errors, hence we
50 preserve the original Windows Error code in thr_winerr.
51*/
52int thr_winerr();
53
54void set_thr_winerr(int winerr);
55
56#endif
57
58#ifndef NDEBUG
59/* Return pointer to DBUG for holding current state */
60struct CODE_STATE;
62
64
66
67#endif
68
69#endif // MY_THREAD_LOCAL_INCLUDED
Some integer typedefs for easier portability.
uint32_t uint32
Definition: my_inttypes.h:67
Some common macros.
uint32 my_thread_id
Definition: my_thread_local.h:34
CODE_STATE ** my_thread_var_dbug()
Definition: my_thr_init.cc:366
void set_my_thread_var_id(my_thread_id id)
Definition: my_thr_init.cc:364
void set_my_errno(int my_errno)
Set the MySQL thread-local storage variant of errno.
Definition: my_thr_init.cc:353
my_thread_id my_thread_var_id()
Definition: my_thr_init.cc:362
int my_errno()
Retrieve the MySQL thread-local storage variant of errno.
Definition: my_thr_init.cc:351
Definition: dbug.cc:220