MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
connection_control.h
Go to the documentation of this file.
1/* Copyright (c) 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 CONNECTION_CONTROL_H
25#define CONNECTION_CONTROL_H
26
46
47extern REQUIRES_SERVICE_PLACEHOLDER(pfs_plugin_column_string_v2);
48extern REQUIRES_SERVICE_PLACEHOLDER(pfs_plugin_table_v1);
49extern REQUIRES_SERVICE_PLACEHOLDER(pfs_plugin_column_integer_v1);
50extern REQUIRES_SERVICE_PLACEHOLDER(mysql_thd_security_context);
51extern REQUIRES_SERVICE_PLACEHOLDER(mysql_security_context_options);
52extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins);
53extern REQUIRES_SERVICE_PLACEHOLDER(log_builtins_string);
54extern REQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_register);
55extern REQUIRES_SERVICE_PLACEHOLDER(component_sys_variable_unregister);
56extern REQUIRES_SERVICE_PLACEHOLDER(status_variable_registration);
58extern REQUIRES_SERVICE_PLACEHOLDER(registry_registration);
60 mysql_service_registry_no_lock);
61extern REQUIRES_SERVICE_PLACEHOLDER_AS(registry_registration,
62 mysql_service_registration_no_lock);
69
71/** Helper class : Wrapper on READ lock */
72
73class RD_lock {
74 public:
76 if (m_lock != nullptr) {
78 }
79 }
81 if (m_lock != nullptr) {
83 }
84 }
87 RD_lock(const RD_lock &) = delete; /* Not copyable. */
88 void operator=(const RD_lock &) = delete; /* Not assignable. */
89
90 private:
92};
93
94/** Helper class : Wrapper on write lock */
95
96class WR_lock {
97 public:
99 if (m_lock != nullptr) {
101 }
102 }
104 if (m_lock != nullptr) {
106 }
107 }
110 WR_lock(const WR_lock &) = delete; /* Not copyable. */
111 void operator=(const WR_lock &) = delete; /* Not assignable. */
112
113 private:
115};
116} // namespace connection_control
117#endif /* !CONNECTION_CONTROL_H */
Helper class : Wrapper on READ lock.
Definition: connection_control.h:73
void operator=(const RD_lock &)=delete
~RD_lock()
Definition: connection_control.h:80
mysql_rwlock_t * m_lock
Definition: connection_control.h:91
RD_lock(mysql_rwlock_t *lock)
Definition: connection_control.h:75
void unlock()
Definition: connection_control.h:86
RD_lock(const RD_lock &)=delete
void lock()
Definition: connection_control.h:85
Helper class : Wrapper on write lock.
Definition: connection_control.h:96
void lock()
Definition: connection_control.h:108
WR_lock(mysql_rwlock_t *lock)
Definition: connection_control.h:98
void unlock()
Definition: connection_control.h:109
WR_lock(const WR_lock &)=delete
mysql_rwlock_t * m_lock
Definition: connection_control.h:114
void operator=(const WR_lock &)=delete
~WR_lock()
Definition: connection_control.h:103
#define mysql_rwlock_rdlock(T)
Definition: mysql_rwlock.h:61
#define mysql_rwlock_unlock(T)
Definition: mysql_rwlock.h:91
#define mysql_rwlock_wrlock(T)
Definition: mysql_rwlock.h:71
REQUIRES_SERVICE_PLACEHOLDER(pfs_plugin_column_string_v2)
PSI_rwlock_key key_connection_event_delay_lock
Definition: connection_control.cc:67
REQUIRES_SERVICE_PLACEHOLDER_AS(registry, mysql_service_registry_no_lock)
PSI_mutex_key key_connection_delay_mutex
Definition: connection_control.cc:61
PSI_stage_info stage_waiting_in_component_connection_control
PSI_cond_key key_connection_delay_wait
Definition: connection_control.cc:73
PSI_memory_key key_connection_delay_memory
Definition: connection_control.cc:55
Helper file to create connection event consumer.
unsigned int PSI_cond_key
Instrumented cond key.
Definition: psi_cond_bits.h:44
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:52
unsigned int PSI_rwlock_key
Instrumented rwlock key.
Definition: psi_rwlock_bits.h:44
Instrumentation helpers for rwlock.
Definition: connection_control.h:70
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
Performance schema instrumentation interface.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
const mysql_service_mysql_current_thread_reader_t * mysql_current_thread_reader
Definition: rewriter_plugin.cc:63
Stage instrument information.
Definition: psi_stage_bits.h:74
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:51