MySQL 9.0.0
Source Code Documentation
mysql_mutex_service.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef COMPONENTS_SERVICES_MYSQL_MUTEX_SERVICE_H
25#define COMPONENTS_SERVICES_MYSQL_MUTEX_SERVICE_H
26
30
31/**
32 @defgroup psi_abi_mutex Mutex Instrumentation (ABI)
33 @ingroup psi_abi
34 @{
35*/
36
37typedef void (*mysql_mutex_register_t)(const char *category,
38 PSI_mutex_info *info, int count);
39
41 const native_mutexattr_t *attr,
42 const char *src_file, unsigned int src_line);
43
44typedef int (*mysql_mutex_destroy_t)(mysql_mutex_t *that, const char *src_file,
45 unsigned int src_line);
46
47typedef int (*mysql_mutex_lock_t)(mysql_mutex_t *that, const char *src_file,
48 unsigned int src_line);
49
50typedef int (*mysql_mutex_trylock_t)(mysql_mutex_t *that, const char *src_file,
51 unsigned int src_line);
52
53typedef int (*mysql_mutex_unlock_t)(mysql_mutex_t *that, const char *src_file,
54 unsigned int src_line);
55
64
65/* Hide the real name from component source code, for versions. */
66#define REQUIRES_MYSQL_MUTEX_SERVICE REQUIRES_SERVICE(mysql_mutex_v1)
67
68/**
69 Mutex service.
70*/
71typedef SERVICE_TYPE(mysql_mutex_v1) mysql_mutex_service_t;
72
73/** @} (end of group psi_abi_mutex) */
74
75#endif /* COMPONENTS_SERVICES_MYSQL_MUTEX_SERVICE_H */
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
int destroy(azio_stream *s)
Definition: azio.cc:371
int(* mysql_mutex_destroy_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:44
int(* mysql_mutex_trylock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:50
void(* mysql_mutex_register_t)(const char *category, PSI_mutex_info *info, int count)
Definition: mysql_mutex_service.h:37
int(* mysql_mutex_init_t)(PSI_mutex_key key, mysql_mutex_t *that, const native_mutexattr_t *attr, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:40
const mysql_service_mysql_mutex_v1_t mysql_mutex_service_t
Mutex service.
Definition: mysql_mutex_service.h:71
int(* mysql_mutex_lock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:47
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:52
int(* mysql_mutex_unlock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:53
static int count
Definition: myisam_ftdump.cc:45
ABI for instrumented mutexes.
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
static const char * category
Definition: sha2_password.cc:170
Instrumentation helpers for mutexes.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
Mutex information.
Definition: psi_mutex_bits.h:73
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
pthread_mutexattr_t native_mutexattr_t
Definition: thr_mutex_bits.h:56