MySQL 8.0.31
Source Code Documentation
mysql_mutex_service.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2022, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef COMPONENTS_SERVICES_MYSQL_MUTEX_SERVICE_H
24#define COMPONENTS_SERVICES_MYSQL_MUTEX_SERVICE_H
25
29
30/**
31 @defgroup psi_abi_mutex Mutex Instrumentation (ABI)
32 @ingroup psi_abi
33 @{
34*/
35
36typedef void (*mysql_mutex_register_t)(const char *category,
38
40 const native_mutexattr_t *attr,
41 const char *src_file, unsigned int src_line);
42
43typedef int (*mysql_mutex_destroy_t)(mysql_mutex_t *that, const char *src_file,
44 unsigned int src_line);
45
46typedef int (*mysql_mutex_lock_t)(mysql_mutex_t *that, const char *src_file,
47 unsigned int src_line);
48
49typedef int (*mysql_mutex_trylock_t)(mysql_mutex_t *that, const char *src_file,
50 unsigned int src_line);
51
52typedef int (*mysql_mutex_unlock_t)(mysql_mutex_t *that, const char *src_file,
53 unsigned int src_line);
54
63
64/* Hide the real name from component source code, for versions. */
65#define REQUIRES_MYSQL_MUTEX_SERVICE REQUIRES_SERVICE(mysql_mutex_v1)
66
67/**
68 Mutex service.
69*/
70typedef SERVICE_TYPE(mysql_mutex_v1) mysql_mutex_service_t;
71
72/** @} (end of group psi_abi_mutex) */
73
74#endif /* COMPONENTS_SERVICES_MYSQL_MUTEX_SERVICE_H */
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:570
int(* mysql_mutex_destroy_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:43
int(* mysql_mutex_trylock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:49
void(* mysql_mutex_register_t)(const char *category, PSI_mutex_info *info, int count)
Definition: mysql_mutex_service.h:36
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:39
const mysql_service_mysql_mutex_v1_t mysql_mutex_service_t
Mutex service.
Definition: mysql_mutex_service.h:70
int(* mysql_mutex_lock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:46
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:51
int(* mysql_mutex_unlock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:52
static int count
Definition: myisam_ftdump.cc:42
ABI for instrumented mutexes.
Log info(cout, "NOTE")
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:78
static mysql_service_status_t destroy(reference_caching_channel channel) noexcept
Definition: component.cc:49
static const char * category
Definition: sha2_password.cc:169
Instrumentation helpers for mutexes.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:75
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
Mutex information.
Definition: psi_mutex_bits.h:72
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
pthread_mutexattr_t native_mutexattr_t
Definition: thr_mutex_bits.h:55