39#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
44#ifndef PSI_RWLOCK_CALL
45#define PSI_RWLOCK_CALL(M) psi_rwlock_service->M
60#define mysql_prlock_assert_write_owner(M) \
61 rw_pr_lock_assert_write_owner(&(M)->m_prlock)
63#define mysql_prlock_assert_write_owner(M) \
73#define mysql_prlock_assert_not_write_owner(M) \
74 rw_pr_lock_assert_not_write_owner(&(M)->m_prlock)
76#define mysql_prlock_assert_not_write_owner(M) \
80#ifndef DISABLE_MYSQL_THREAD_H
86#define mysql_rwlock_register(P1, P2, P3) \
87 inline_mysql_rwlock_register(P1, P2, P3)
98#define mysql_rwlock_init(K, T) \
99 mysql_rwlock_init_with_src(K, T, __FILE__, __LINE__)
101#define mysql_rwlock_init_with_src(K, T, F, L) \
102 inline_mysql_rwlock_init(K, T, F, L)
112#define mysql_prlock_init(K, T) \
113 mysql_prlock_init_with_src(K, T, __FILE__, __LINE__)
115#define mysql_prlock_init_with_src(K, T, F, L) \
116 inline_mysql_prlock_init(K, T, F, L)
125#define mysql_rwlock_destroy(T) \
126 mysql_rwlock_destroy_with_src(T, __FILE__, __LINE__)
128#define mysql_rwlock_destroy_with_src(T, F, L) \
129 inline_mysql_rwlock_destroy(T, F, L)
137#define mysql_prlock_destroy(T) \
138 mysql_prlock_destroy_with_src(T, __FILE__, __LINE__)
140#define mysql_prlock_destroy_with_src(T, F, L) \
141 inline_mysql_prlock_destroy(T, F, L)
150#define mysql_rwlock_rdlock(T) \
151 mysql_rwlock_rdlock_with_src(T, __FILE__, __LINE__)
153#define mysql_rwlock_rdlock_with_src(T, F, L) \
154 inline_mysql_rwlock_rdlock(T, F, L)
163#define mysql_prlock_rdlock(T) \
164 mysql_prlock_rdlock_with_src(T, __FILE__, __LINE__)
166#define mysql_prlock_rdlock_with_src(T, F, L) \
167 inline_mysql_prlock_rdlock(T, F, L)
176#define mysql_rwlock_wrlock(T) \
177 mysql_rwlock_wrlock_with_src(T, __FILE__, __LINE__)
179#define mysql_rwlock_wrlock_with_src(T, F, L) \
180 inline_mysql_rwlock_wrlock(T, F, L)
189#define mysql_prlock_wrlock(T) \
190 mysql_prlock_wrlock_with_src(T, __FILE__, __LINE__)
192#define mysql_prlock_wrlock_with_src(T, F, L) \
193 inline_mysql_prlock_wrlock(T, F, L)
202#define mysql_rwlock_tryrdlock(T) \
203 mysql_rwlock_tryrdlock_with_src(T, __FILE__, __LINE__)
205#define mysql_rwlock_tryrdlock_with_src(T, F, L) \
206 inline_mysql_rwlock_tryrdlock(T, F, L)
215#define mysql_rwlock_trywrlock(T) \
216 mysql_rwlock_trywrlock_with_src(T, __FILE__, __LINE__)
218#define mysql_rwlock_trywrlock_with_src(T, F, L) \
219 inline_mysql_rwlock_trywrlock(T, F, L)
227#define mysql_rwlock_unlock(T) \
228 mysql_rwlock_unlock_with_src(T, __FILE__, __LINE__)
230#define mysql_rwlock_unlock_with_src(T, F, L) \
231 inline_mysql_rwlock_unlock(T, F, L)
240#define mysql_prlock_unlock(T) \
241 mysql_prlock_unlock_with_src(T, __FILE__, __LINE__)
243#define mysql_prlock_unlock_with_src(T, F, L) \
244 inline_mysql_prlock_unlock(T, F, L)
250 int count [[maybe_unused]]) {
251#ifdef HAVE_PSI_RWLOCK_INTERFACE
260 int src_line [[maybe_unused]]) {
261#ifdef HAVE_PSI_RWLOCK_INTERFACE
264 that->
m_psi =
nullptr;
269#ifndef DISABLE_MYSQL_PRLOCK_H
274 int src_line [[maybe_unused]]) {
275#ifdef HAVE_PSI_RWLOCK_INTERFACE
278 that->
m_psi =
nullptr;
287 int src_line [[maybe_unused]]) {
288#ifdef HAVE_PSI_RWLOCK_INTERFACE
289 if (that->
m_psi !=
nullptr) {
291 that->
m_psi =
nullptr;
297#ifndef DISABLE_MYSQL_PRLOCK_H
301 int src_line [[maybe_unused]]) {
302#ifdef HAVE_PSI_RWLOCK_INTERFACE
303 if (that->
m_psi !=
nullptr) {
305 that->
m_psi =
nullptr;
315 int src_line [[maybe_unused]]) {
318#ifdef HAVE_PSI_RWLOCK_INTERFACE
319 if (that->
m_psi !=
nullptr) {
331 if (locker !=
nullptr) {
346#ifndef DISABLE_MYSQL_PRLOCK_H
350 int src_line [[maybe_unused]]) {
353#ifdef HAVE_PSI_RWLOCK_INTERFACE
354 if (that->
m_psi !=
nullptr) {
366 if (locker !=
nullptr) {
385 int src_line [[maybe_unused]]) {
388#ifdef HAVE_PSI_RWLOCK_INTERFACE
389 if (that->
m_psi !=
nullptr) {
401 if (locker !=
nullptr) {
416#ifndef DISABLE_MYSQL_PRLOCK_H
420 int src_line [[maybe_unused]]) {
423#ifdef HAVE_PSI_RWLOCK_INTERFACE
424 if (that->
m_psi !=
nullptr) {
436 if (locker !=
nullptr) {
455 int src_line [[maybe_unused]]) {
458#ifdef HAVE_PSI_RWLOCK_INTERFACE
459 if (that->
m_psi !=
nullptr) {
471 if (locker !=
nullptr) {
489 int src_line [[maybe_unused]]) {
492#ifdef HAVE_PSI_RWLOCK_INTERFACE
493 if (that->
m_psi !=
nullptr) {
505 if (locker !=
nullptr) {
523 int src_line [[maybe_unused]]) {
525#ifdef HAVE_PSI_RWLOCK_INTERFACE
526 if (that->
m_psi !=
nullptr) {
536#ifndef DISABLE_MYSQL_PRLOCK_H
540 int src_line [[maybe_unused]]) {
542#ifdef HAVE_PSI_RWLOCK_INTERFACE
543 if (that->
m_psi !=
nullptr) {
#define PSI_RWLOCK_CALL(M)
Definition: psi_rwlock.h:36
unsigned int PSI_rwlock_key
Instrumented rwlock key.
Definition: psi_rwlock_bits.h:44
struct PSI_rwlock_locker PSI_rwlock_locker
Definition: psi_rwlock_bits.h:79
@ PSI_RWLOCK_TRYWRITELOCK
Write lock attempt.
Definition: psi_rwlock_bits.h:132
@ PSI_RWLOCK_WRITELOCK
Write lock.
Definition: psi_rwlock_bits.h:128
@ PSI_RWLOCK_UNLOCK
Unlock (Read or Write).
Definition: psi_rwlock_bits.h:134
@ PSI_RWLOCK_TRYREADLOCK
Read lock attempt.
Definition: psi_rwlock_bits.h:130
@ PSI_RWLOCK_READLOCK
Read lock.
Definition: psi_rwlock_bits.h:126
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:256
static int inline_mysql_prlock_wrlock(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:417
static int inline_mysql_prlock_unlock(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:537
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:270
static int inline_mysql_rwlock_unlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:520
static int inline_mysql_prlock_destroy(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:298
static int inline_mysql_rwlock_trywrlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:486
static int inline_mysql_rwlock_destroy(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:284
static int inline_mysql_rwlock_rdlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:312
static int inline_mysql_rwlock_wrlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:382
static int inline_mysql_rwlock_tryrdlock(mysql_rwlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:452
static void inline_mysql_rwlock_register(const char *category, PSI_rwlock_info *info, int count)
Definition: mysql_rwlock.h:246
static int inline_mysql_prlock_rdlock(mysql_prlock_t *that, const char *src_file, int src_line)
Definition: mysql_rwlock.h:347
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static int count
Definition: myisam_ftdump.cc:45
Instrumentation helpers for rwlock.
static const char * category
Definition: sha2_password.cc:170
Performance schema instrumentation (declarations).
struct result result
Definition: result.h:34
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
bool m_enabled
Instrumentation is enabled.
Definition: psi_bits.h:191
Rwlock information.
Definition: psi_rwlock_bits.h:162
State data storage for start_rwlock_rdwait_v1_t, start_rwlock_wrwait_v1_t.
Definition: psi_rwlock_bits.h:194
An instrumented prlock structure.
Definition: mysql_rwlock_bits.h:72
struct PSI_rwlock * m_psi
The instrumentation hook.
Definition: mysql_rwlock_bits.h:80
rw_pr_lock_t m_prlock
The real prlock.
Definition: mysql_rwlock_bits.h:74
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:51
struct PSI_rwlock * m_psi
The instrumentation hook.
Definition: mysql_rwlock_bits.h:59
native_rw_lock_t m_rwlock
The real rwlock.
Definition: mysql_rwlock_bits.h:53
MySQL rwlock implementation.
static int native_rw_init(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:59
int rw_pr_wrlock(rw_pr_lock_t *)
Definition: thr_rwlock.cc:67
int rw_pr_destroy(rw_pr_lock_t *)
Definition: thr_rwlock.cc:48
static int native_rw_trywrlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:106
int rw_pr_rdlock(rw_pr_lock_t *)
Definition: thr_rwlock.cc:54
static int native_rw_tryrdlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:87
static int native_rw_destroy(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:70
int rw_pr_unlock(rw_pr_lock_t *)
Definition: thr_rwlock.cc:100
static int native_rw_rdlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:78
static int native_rw_unlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:116
static int native_rw_wrlock(native_rw_lock_t *rwp)
Definition: thr_rwlock.h:96
int rw_pr_init(rw_pr_lock_t *)
Definition: thr_rwlock.cc:36