MySQL 8.1.0
Source Code Documentation
service_thread_scheduler.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2010, 2023, 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 also distributed 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 included with MySQL.
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
25#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED
26#define SERVICE_THREAD_SCHEDULER_INCLUDED
27
28/**
29 @file include/mysql/service_thread_scheduler.h
30*/
31
34
35extern "C" struct my_thread_scheduler_service {
37 struct THD_event_functions *);
40
41#ifdef MYSQL_DYNAMIC_PLUGIN
42
43#define my_connection_handler_set(F, M) \
44 my_thread_scheduler_service->connection_handler_set((F), (M))
45#define my_connection_handler_reset() \
46 my_thread_scheduler_service->connection_handler_reset()
47
48#else
49
50/**
51 Instantiates Plugin_connection_handler based on the supplied
52 Conection_handler_functions and sets it as the current
53 connection handler.
54
55 Also sets the THD_event_functions functions which will
56 be called by the server when e.g. beginning a wait.
57
58 Remembers the existing connection handler so that it can be restored later.
59
60 @param chf struct with functions to be called when e.g. handling
61 new clients.
62 @param tef struct with functions to be called when events
63 (e.g. lock wait) happens.
64
65 @note Both pointers (i.e. not the structs themselves) will be copied,
66 so the structs must not disappear.
67
68 @note We don't support dynamically loading more than one connection handler.
69
70 @retval 1 failure
71 @retval 0 success
72*/
74 struct THD_event_functions *tef);
75
76/**
77 Destroys the current connection handler and restores the previous.
78 Should only be called after calling my_connection_handler_set().
79
80 @retval 1 failure
81 @retval 0 success
82*/
84
85#endif /* MYSQL_DYNAMIC_PLUGIN */
86
87#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:301
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:284
This structure must be populated by plugins which implement connection handlers and passed as an argu...
Definition: thread_pool_priv.h:63
Functions to notify interested connection handlers of events like beginning of wait and end of wait a...
Definition: connection_handler_manager.h:46
Definition: service_thread_scheduler.h:35
int(* connection_handler_set)(struct Connection_handler_functions *, struct THD_event_functions *)
Definition: service_thread_scheduler.h:36
int(* connection_handler_reset)()
Definition: service_thread_scheduler.h:38