38#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
43#ifndef PSI_RWLOCK_CALL
44#define PSI_RWLOCK_CALL(M) psi_rwlock_service->M
59#define mysql_prlock_assert_write_owner(M) \
60 rw_pr_lock_assert_write_owner(&(M)->m_prlock)
62#define mysql_prlock_assert_write_owner(M) \
72#define mysql_prlock_assert_not_write_owner(M) \
73 rw_pr_lock_assert_not_write_owner(&(M)->m_prlock)
75#define mysql_prlock_assert_not_write_owner(M) \
79#ifndef DISABLE_MYSQL_THREAD_H
85#define mysql_rwlock_register(P1, P2, P3) \
86 inline_mysql_rwlock_register(P1, P2, P3)
97#define mysql_rwlock_init(K, T) \
98 mysql_rwlock_init_with_src(K, T, __FILE__, __LINE__)
100#define mysql_rwlock_init_with_src(K, T, F, L) \
101 inline_mysql_rwlock_init(K, T, F, L)
111#define mysql_prlock_init(K, T) \
112 mysql_prlock_init_with_src(K, T, __FILE__, __LINE__)
114#define mysql_prlock_init_with_src(K, T, F, L) \
115 inline_mysql_prlock_init(K, T, F, L)
124#define mysql_rwlock_destroy(T) \
125 mysql_rwlock_destroy_with_src(T, __FILE__, __LINE__)
127#define mysql_rwlock_destroy_with_src(T, F, L) \
128 inline_mysql_rwlock_destroy(T, F, L)
136#define mysql_prlock_destroy(T) \
137 mysql_prlock_destroy_with_src(T, __FILE__, __LINE__)
139#define mysql_prlock_destroy_with_src(T, F, L) \
140 inline_mysql_prlock_destroy(T, F, L)
149#define mysql_rwlock_rdlock(T) \
150 mysql_rwlock_rdlock_with_src(T, __FILE__, __LINE__)
152#define mysql_rwlock_rdlock_with_src(T, F, L) \
153 inline_mysql_rwlock_rdlock(T, F, L)
162#define mysql_prlock_rdlock(T) \
163 mysql_prlock_rdlock_with_src(T, __FILE__, __LINE__)
165#define mysql_prlock_rdlock_with_src(T, F, L) \
166 inline_mysql_prlock_rdlock(T, F, L)
175#define mysql_rwlock_wrlock(T) \
176 mysql_rwlock_wrlock_with_src(T, __FILE__, __LINE__)
178#define mysql_rwlock_wrlock_with_src(T, F, L) \
179 inline_mysql_rwlock_wrlock(T, F, L)
188#define mysql_prlock_wrlock(T) \
189 mysql_prlock_wrlock_with_src(T, __FILE__, __LINE__)
191#define mysql_prlock_wrlock_with_src(T, F, L) \
192 inline_mysql_prlock_wrlock(T, F, L)
201#define mysql_rwlock_tryrdlock(T) \
202 mysql_rwlock_tryrdlock_with_src(T, __FILE__, __LINE__)
204#define mysql_rwlock_tryrdlock_with_src(T, F, L) \
205 inline_mysql_rwlock_tryrdlock(T, F, L)
214#define mysql_rwlock_trywrlock(T) \
215 mysql_rwlock_trywrlock_with_src(T, __FILE__, __LINE__)
217#define mysql_rwlock_trywrlock_with_src(T, F, L) \
218 inline_mysql_rwlock_trywrlock(T, F, L)
226#define mysql_rwlock_unlock(T) \
227 mysql_rwlock_unlock_with_src(T, __FILE__, __LINE__)
229#define mysql_rwlock_unlock_with_src(T, F, L) \
230 inline_mysql_rwlock_unlock(T, F, L)
239#define mysql_prlock_unlock(T) \
240 mysql_prlock_unlock_with_src(T, __FILE__, __LINE__)
242#define mysql_prlock_unlock_with_src(T, F, L) \
243 inline_mysql_prlock_unlock(T, F, L)
249 int count [[maybe_unused]]) {
250#ifdef HAVE_PSI_RWLOCK_INTERFACE
259 int src_line [[maybe_unused]]) {
260#ifdef HAVE_PSI_RWLOCK_INTERFACE
263 that->
m_psi =
nullptr;
268#ifndef DISABLE_MYSQL_PRLOCK_H
273 int src_line [[maybe_unused]]) {
274#ifdef HAVE_PSI_RWLOCK_INTERFACE
277 that->
m_psi =
nullptr;
286 int src_line [[maybe_unused]]) {
287#ifdef HAVE_PSI_RWLOCK_INTERFACE
288 if (that->
m_psi !=
nullptr) {
290 that->
m_psi =
nullptr;
296#ifndef DISABLE_MYSQL_PRLOCK_H
300 int src_line [[maybe_unused]]) {
301#ifdef HAVE_PSI_RWLOCK_INTERFACE
302 if (that->
m_psi !=
nullptr) {
304 that->
m_psi =
nullptr;
314 int src_line [[maybe_unused]]) {
317#ifdef HAVE_PSI_RWLOCK_INTERFACE
318 if (that->
m_psi !=
nullptr) {
330 if (locker !=
nullptr) {
345#ifndef DISABLE_MYSQL_PRLOCK_H
349 int src_line [[maybe_unused]]) {
352#ifdef HAVE_PSI_RWLOCK_INTERFACE
353 if (that->
m_psi !=
nullptr) {
365 if (locker !=
nullptr) {
384 int src_line [[maybe_unused]]) {
387#ifdef HAVE_PSI_RWLOCK_INTERFACE
388 if (that->
m_psi !=
nullptr) {
400 if (locker !=
nullptr) {
415#ifndef DISABLE_MYSQL_PRLOCK_H
419 int src_line [[maybe_unused]]) {
422#ifdef HAVE_PSI_RWLOCK_INTERFACE
423 if (that->
m_psi !=
nullptr) {
435 if (locker !=
nullptr) {
454 int src_line [[maybe_unused]]) {
457#ifdef HAVE_PSI_RWLOCK_INTERFACE
458 if (that->
m_psi !=
nullptr) {
470 if (locker !=
nullptr) {
488 int src_line [[maybe_unused]]) {
491#ifdef HAVE_PSI_RWLOCK_INTERFACE
492 if (that->
m_psi !=
nullptr) {
504 if (locker !=
nullptr) {
522 int src_line [[maybe_unused]]) {
524#ifdef HAVE_PSI_RWLOCK_INTERFACE
525 if (that->
m_psi !=
nullptr) {
535#ifndef DISABLE_MYSQL_PRLOCK_H
539 int src_line [[maybe_unused]]) {
541#ifdef HAVE_PSI_RWLOCK_INTERFACE
542 if (that->
m_psi !=
nullptr) {
#define PSI_RWLOCK_CALL(M)
Definition: psi_rwlock.h:35
unsigned int PSI_rwlock_key
Instrumented rwlock key.
Definition: psi_rwlock_bits.h:43
struct PSI_rwlock_locker PSI_rwlock_locker
Definition: psi_rwlock_bits.h:78
@ PSI_RWLOCK_TRYWRITELOCK
Write lock attempt.
Definition: psi_rwlock_bits.h:131
@ PSI_RWLOCK_WRITELOCK
Write lock.
Definition: psi_rwlock_bits.h:127
@ PSI_RWLOCK_UNLOCK
Unlock (Read or Write).
Definition: psi_rwlock_bits.h:133
@ PSI_RWLOCK_TRYREADLOCK
Read lock attempt.
Definition: psi_rwlock_bits.h:129
@ PSI_RWLOCK_READLOCK
Read lock.
Definition: psi_rwlock_bits.h:125
static int inline_mysql_rwlock_init(PSI_rwlock_key key, mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:255
static int inline_mysql_prlock_wrlock(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:416
static int inline_mysql_prlock_unlock(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:536
static int inline_mysql_prlock_init(PSI_rwlock_key key, mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:269
static int inline_mysql_rwlock_unlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:519
static int inline_mysql_prlock_destroy(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:297
static int inline_mysql_rwlock_trywrlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:485
static int inline_mysql_rwlock_destroy(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:283
static int inline_mysql_rwlock_rdlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:311
static int inline_mysql_rwlock_wrlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:381
static int inline_mysql_rwlock_tryrdlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:451
static void inline_mysql_rwlock_register(const char *category, PSI_rwlock_info *info, int count)
Definition: mysql_rwlock.h:245
static int inline_mysql_prlock_rdlock(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:346
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static int count
Definition: myisam_ftdump.cc:44
Instrumentation helpers for rwlock.
static const char * category
Definition: sha2_password.cc:169
Performance schema instrumentation (declarations).
struct result result
Definition: result.h:33
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
bool m_enabled
Instrumentation is enabled.
Definition: psi_bits.h:180
Rwlock information.
Definition: psi_rwlock_bits.h:161
State data storage for start_rwlock_rdwait_v1_t, start_rwlock_wrwait_v1_t.
Definition: psi_rwlock_bits.h:193
An instrumented prlock structure.
Definition: mysql_rwlock_bits.h:71
struct PSI_rwlock * m_psi
The instrumentation hook.
Definition: mysql_rwlock_bits.h:79
rw_pr_lock_t m_prlock
The real prlock.
Definition: mysql_rwlock_bits.h:73
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:50
struct PSI_rwlock * m_psi
The instrumentation hook.
Definition: mysql_rwlock_bits.h:58
native_rw_lock_t m_rwlock
The real rwlock.
Definition: mysql_rwlock_bits.h:52
MySQL rwlock implementation.
static int native_rw_init(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:58
int rw_pr_wrlock(rw_pr_lock_t *)
Definition: thr_rwlock.cc:66
int rw_pr_destroy(rw_pr_lock_t *)
Definition: thr_rwlock.cc:47
static int native_rw_trywrlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:105
int rw_pr_rdlock(rw_pr_lock_t *)
Definition: thr_rwlock.cc:53
static int native_rw_tryrdlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:86
static int native_rw_destroy(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:69
int rw_pr_unlock(rw_pr_lock_t *)
Definition: thr_rwlock.cc:99
static int native_rw_rdlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:77
static int native_rw_unlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:115
static int native_rw_wrlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:95
int rw_pr_init(rw_pr_lock_t *)
Definition: thr_rwlock.cc:35