MySQL 8.2.0
Source Code Documentation
my_thread_local.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2023, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MY_THREAD_LOCAL_INCLUDED
24#define MY_THREAD_LOCAL_INCLUDED
25
26/**
27 @file include/my_thread_local.h
28*/
29
30#include "my_inttypes.h"
31#include "my_macros.h"
32
34
35/**
36 Retrieve the MySQL thread-local storage variant of errno.
37*/
38int my_errno();
39
40/**
41 Set the MySQL thread-local storage variant of errno.
42*/
43void set_my_errno(int my_errno);
44
45#ifdef _WIN32
46/*
47 thr_winerr is used for returning the original OS error-code in Windows,
48 my_osmaperr() returns EINVAL for all unknown Windows errors, hence we
49 preserve the original Windows Error code in thr_winerr.
50*/
51int thr_winerr();
52
53void set_thr_winerr(int winerr);
54
55#endif
56
57#ifndef NDEBUG
58/* Return pointer to DBUG for holding current state */
59struct CODE_STATE;
61
63
65
66#endif
67
68#endif // MY_THREAD_LOCAL_INCLUDED
Some integer typedefs for easier portability.
uint32_t uint32
Definition: my_inttypes.h:66
Some common macros.
uint32 my_thread_id
Definition: my_thread_local.h:33
CODE_STATE ** my_thread_var_dbug()
Definition: my_thr_init.cc:351
void set_my_thread_var_id(my_thread_id id)
Definition: my_thr_init.cc:349
void set_my_errno(int my_errno)
Set the MySQL thread-local storage variant of errno.
Definition: my_thr_init.cc:338
my_thread_id my_thread_var_id()
Definition: my_thr_init.cc:347
int my_errno()
Retrieve the MySQL thread-local storage variant of errno.
Definition: my_thr_init.cc:336
Definition: dbug.cc:220