MySQL 8.0.39
Source Code Documentation
service_thread_scheduler.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2010, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED
27#define SERVICE_THREAD_SCHEDULER_INCLUDED
28
29/**
30 @file include/mysql/service_thread_scheduler.h
31*/
32
35
36extern "C" struct my_thread_scheduler_service {
38 struct THD_event_functions *);
41
42#ifdef MYSQL_DYNAMIC_PLUGIN
43
44#define my_connection_handler_set(F, M) \
45 my_thread_scheduler_service->connection_handler_set((F), (M))
46#define my_connection_handler_reset() \
47 my_thread_scheduler_service->connection_handler_reset()
48
49#else
50
51/**
52 Instantiates Plugin_connection_handler based on the supplied
53 Conection_handler_functions and sets it as the current
54 connection handler.
55
56 Also sets the THD_event_functions functions which will
57 be called by the server when e.g. beginning a wait.
58
59 Remembers the existing connection handler so that it can be restored later.
60
61 @param chf struct with functions to be called when e.g. handling
62 new clients.
63 @param tef struct with functions to be called when events
64 (e.g. lock wait) happens.
65
66 @note Both pointers (i.e. not the structs themselves) will be copied,
67 so the structs must not disappear.
68
69 @note We don't support dynamically loading more than one connection handler.
70
71 @retval 1 failure
72 @retval 0 success
73*/
75 struct THD_event_functions *tef);
76
77/**
78 Destroys the current connection handler and restores the previous.
79 Should only be called after calling my_connection_handler_set().
80
81 @retval 1 failure
82 @retval 0 success
83*/
85
86#endif /* MYSQL_DYNAMIC_PLUGIN */
87
88#endif /* SERVICE_THREAD_SCHEDULER_INCLUDED */
struct my_thread_scheduler_service * my_thread_scheduler_service
int my_connection_handler_reset()
Destroys the current connection handler and restores the previous.
Definition: connection_handler_manager.cc:304
int my_connection_handler_set(struct Connection_handler_functions *chf, struct THD_event_functions *tef)
Instantiates Plugin_connection_handler based on the supplied Conection_handler_functions and sets it ...
Definition: connection_handler_manager.cc:287
This structure must be populated by plugins which implement connection handlers and passed as an argu...
Definition: thread_pool_priv.h:64
Functions to notify interested connection handlers of events like beginning of wait and end of wait a...
Definition: connection_handler_manager.h:47
Definition: service_thread_scheduler.h:36
int(* connection_handler_set)(struct Connection_handler_functions *, struct THD_event_functions *)
Definition: service_thread_scheduler.h:37
int(* connection_handler_reset)()
Definition: service_thread_scheduler.h:39