MySQL  8.0.21
Source Code Documentation
mysql_current_thread_reader.h
Go to the documentation of this file.
1 /* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
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 MYSQL_CURRENT_THREAD_READER_H
24 #define MYSQL_CURRENT_THREAD_READER_H
25 
27 
28 #ifdef __cplusplus
29 class THD;
30 #define MYSQL_THD THD *
31 #else
32 #define MYSQL_THD void *
33 #endif
34 
35 /**
36  @ingroup group_components_services_inventory
37 
38  A service to fetch the current thread id
39 
40  Use in conjuntion with all the related services that operate on thread ids
41  @sa mysql_component_mysql_current_thread_reader_imp
42 */
43 BEGIN_SERVICE_DEFINITION(mysql_current_thread_reader)
44 /**
45  get the current THD.
46 
47  @param[out] thread id
48  @return Status of performed operation
49  @retval false success (valid password)
50  @retval true failure (invalid password)
51 */
53 
54 END_SERVICE_DEFINITION(mysql_current_thread_reader)
55 
56 #endif /* MYSQL_CURRENT_THREAD_READER_H */
#define END_SERVICE_DEFINITION(name)
Type get(const Shards< COUNT > &shards, size_t id) noexcept
Get the counter value for a shard.
Definition: ut0counter.h:310
#define BEGIN_SERVICE_DEFINITION(name)
#define DECLARE_BOOL_METHOD(name, args)
#define MYSQL_THD
Definition: mysql_current_thread_reader.h:30
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:799