MySQL  8.0.17
Source Code Documentation
mysql_mutex_service.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
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 also distributed 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 included with MySQL.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, 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 
36 typedef void (*mysql_mutex_register_t)(const char *category,
37  PSI_mutex_info *info, int count);
38 
40  const native_mutexattr_t *attr,
41  const char *src_file, unsigned int src_line);
42 
43 typedef int (*mysql_mutex_destroy_t)(mysql_mutex_t *that, const char *src_file,
44  unsigned int src_line);
45 
46 typedef int (*mysql_mutex_lock_t)(mysql_mutex_t *that, const char *src_file,
47  unsigned int src_line);
48 
49 typedef int (*mysql_mutex_trylock_t)(mysql_mutex_t *that, const char *src_file,
50  unsigned int src_line);
51 
52 typedef int (*mysql_mutex_unlock_t)(mysql_mutex_t *that, const char *src_file,
53  unsigned int src_line);
54 
55 BEGIN_SERVICE_DEFINITION(mysql_mutex_v1)
56 mysql_mutex_register_t register_info;
62 END_SERVICE_DEFINITION(mysql_mutex_v1)
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 */
70 typedef 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 */
ssize_t count
Definition: memcached.c:386
int(* mysql_mutex_lock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:46
#define SERVICE_TYPE(name)
int(* mysql_mutex_unlock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:52
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:519
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:49
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_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
#define BEGIN_SERVICE_DEFINITION(name)
Instrumentation helpers for mutexes.
Mutex information.
Definition: psi_mutex_bits.h:70
static const char * key
Definition: suite_stubs.c:14
static const char * category
Definition: sha2_password.cc:168
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
int(* mysql_mutex_trylock_t)(mysql_mutex_t *that, const char *src_file, unsigned int src_line)
Definition: mysql_mutex_service.h:49
ABI for instrumented mutexes.
void destroy(T *ptr)
Definition: my_alloc.h:377
Log info(cout, "NOTE")
#define END_SERVICE_DEFINITION(name)
const mysql_service_mysql_mutex_v1_t mysql_mutex_service_t
Mutex service.
Definition: mysql_mutex_service.h:70
void(* mysql_mutex_register_t)(const char *category, PSI_mutex_info *info, int count)
Definition: mysql_mutex_service.h:36
pthread_mutexattr_t native_mutexattr_t
Definition: thr_mutex_bits.h:55