16
16
#include "srv0srv.h"
18
18
/* number of system calls made during shared latching */
19
UNIV_INTERN ulint rw_s_system_call_count = 0;
19
ulint rw_s_system_call_count = 0;
21
21
/* number of spin waits on rw-latches,
22
22
resulted during shared (read) locks */
23
UNIV_INTERN ulint rw_s_spin_wait_count = 0;
23
ulint rw_s_spin_wait_count = 0;
25
25
/* number of OS waits on rw-latches,
26
26
resulted during shared (read) locks */
27
UNIV_INTERN ulint rw_s_os_wait_count = 0;
27
ulint rw_s_os_wait_count = 0;
29
29
/* number of unlocks (that unlock shared locks),
30
30
set only when UNIV_SYNC_PERF_STAT is defined */
31
UNIV_INTERN ulint rw_s_exit_count = 0;
31
ulint rw_s_exit_count = 0;
33
33
/* number of system calls made during exclusive latching */
34
UNIV_INTERN ulint rw_x_system_call_count = 0;
34
ulint rw_x_system_call_count = 0;
36
36
/* number of spin waits on rw-latches,
37
37
resulted during exclusive (write) locks */
38
UNIV_INTERN ulint rw_x_spin_wait_count = 0;
38
ulint rw_x_spin_wait_count = 0;
40
40
/* number of OS waits on rw-latches,
41
41
resulted during exclusive (write) locks */
42
UNIV_INTERN ulint rw_x_os_wait_count = 0;
42
ulint rw_x_os_wait_count = 0;
44
44
/* number of unlocks (that unlock exclusive locks),
45
45
set only when UNIV_SYNC_PERF_STAT is defined */
46
UNIV_INTERN ulint rw_x_exit_count = 0;
46
ulint rw_x_exit_count = 0;
48
48
/* The global list of rw-locks */
49
UNIV_INTERN rw_lock_list_t rw_lock_list;
50
UNIV_INTERN mutex_t rw_lock_list_mutex;
49
rw_lock_list_t rw_lock_list;
50
mutex_t rw_lock_list_mutex;
52
52
#ifdef UNIV_SYNC_DEBUG
53
53
/* The global mutex which protects debug info lists of all rw-locks.
54
54
To modify the debug info list of an rw-lock, this mutex has to be
55
55
acquired in addition to the mutex protecting the lock. */
57
UNIV_INTERN mutex_t rw_lock_debug_mutex;
58
/* If deadlock detection does not get immediately the mutex,
59
it may wait for this event */
60
UNIV_INTERN os_event_t rw_lock_debug_event;
61
/* This is set to TRUE, if there may be waiters for the event */
62
UNIV_INTERN ibool rw_lock_debug_waiters;
57
mutex_t rw_lock_debug_mutex;
58
os_event_t rw_lock_debug_event; /* If deadlock detection does not
59
get immediately the mutex, it may
60
wait for this event */
61
ibool rw_lock_debug_waiters; /* This is set to TRUE, if there may
62
be waiters for the event */
64
64
/**********************************************************************
65
65
Creates a debug info struct. */