1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*****************************************************************************
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
briefly in the InnoDB documentation. The contributions by Google are
incorporated with their permission, and subject to the conditions contained in
the file COPYING.Google.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
*****************************************************************************/
/**************************************************//**
@file include/sync0debug.h
Debug checks for latches, header file
Created 2012-08-21 Sunny Bains
*******************************************************/
#ifndef sync0debug_h
#define sync0debug_h
#include "univ.i"
/** Initializes the synchronization data structures. */
void
sync_check_init();
/** Free the InnoDB synchronization data structures. */
void
sync_check_close();
#ifdef UNIV_DEBUG
/** Check if it is OK to acquire the latch.
@param[in] latch latch type */
void
sync_check_lock_validate(const latch_t* latch);
/** Note that the lock has been granted
@param[in] latch latch type */
void
sync_check_lock_granted(const latch_t* latch);
/** Removes a latch from the thread level array if it is found there.
@param[in] latch to unlock */
void
sync_check_unlock(const latch_t* latch);
/** Checks if the level array for the current thread contains a
mutex or rw-latch at the specified level.
@param[in] level to find
@return a matching latch, or NULL if not found */
const latch_t*
sync_check_find(latch_level_t level);
/** Checks that the level array for the current thread is empty.
Terminate iteration if the functor returns true.
@param[in] functor called for each element.
@return true if the functor returns true for any element */
bool
sync_check_iterate(const sync_check_functor_t& functor);
#endif /* UNIV_DEBUG */
#endif /* !sync0debug_h */
|