120 static void add(
const THD *thd,
const std::string &target)
noexcept;
126 static bool enabled(
const THD *thd,
const std::string &target)
noexcept;
131 static bool enabled(
const std::string &target)
noexcept;
136 static void erase(
const THD *thd,
const std::string &target)
noexcept;
139 using Targets = std::vector<std::string, ut::allocator<std::string>>;
140 using Sync_points = std::vector<Sync_point, ut::allocator<Sync_point>>;
For handling sync points in child threads spawned by a foreground thread.
Definition: sync0debug.h:104
std::vector< Sync_point, ut::allocator< Sync_point > > Sync_points
Definition: sync0debug.h:140
const THD * m_thd
Server connection/session context.
Definition: sync0debug.h:149
Sync_point(const THD *thd) noexcept
Constructor.
Definition: sync0debug.h:108
std::vector< std::string, ut::allocator< std::string > > Targets
Definition: sync0debug.h:139
static void add(const THD *thd, const std::string &target) noexcept
Add a target to the list of sync points, nop for duplicates.
Definition: sync0debug.cc:1711
~Sync_point()=default
Destructor.
Sync_point(const Sync_point &)=default
static Sync_points s_sync_points
Sync points.
Definition: sync0debug.h:146
static bool enabled(const THD *thd, const std::string &target) noexcept
Check if a target is enabled.
Definition: sync0debug.cc:1732
static void erase(const THD *thd, const std::string &target) noexcept
Clear the named target.
Definition: sync0debug.cc:1758
Sync_point & operator=(const Sync_point &)=default
static std::mutex s_mutex
Mutex protecting access to Sync_point infrastructure.
Definition: sync0debug.h:143
Targets m_targets
List of enabled targets.
Definition: sync0debug.h:152
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
All (ordered) latches, used in debugging, must derive from this class.
Definition: sync0types.h:962
Subclass this to iterate over a thread's acquired latch levels.
Definition: sync0types.h:1043
void sync_check_relock(const latch_t *latch)
Check if it is OK to re-acquire the lock.
Definition: sync0debug.cc:1052
const latch_t * sync_check_find(latch_level_t level)
Checks if the level array for the current thread contains a mutex or rw-latch at the specified level.
Definition: sync0debug.cc:1070
bool sync_check_iterate(sync_check_functor_t &functor)
Checks that the level array for the current thread is empty.
Definition: sync0debug.cc:1082
void sync_check_unlock(const latch_t *latch)
Removes a latch from the thread level array if it is found there.
Definition: sync0debug.cc:1060
void sync_check_close()
Frees the resources in synchronization data structures.
Definition: sync0debug.cc:1689
void sync_check_lock_validate(const latch_t *latch)
Check if it is OK to acquire the latch.
Definition: sync0debug.cc:1023
void sync_check_lock_granted(const latch_t *latch)
Note that the lock has been granted.
Definition: sync0debug.cc:1031
void rw_lock_debug_mutex_enter()
Acquires the debug mutex.
Definition: sync0debug.cc:1146
void rw_lock_debug_mutex_exit()
Releases the debug mutex.
Definition: sync0debug.cc:1172
void sync_check_enable()
Enable sync order checking.
Definition: sync0debug.cc:1094
void sync_check_lock(const latch_t *latch, latch_level_t level)
Check if it is OK to acquire the latch.
Definition: sync0debug.cc:1040
void sync_check_init(size_t max_threads)
Initializes the synchronization data structures.
Definition: sync0debug.cc:1666
latch_level_t
Latching order levels.
Definition: sync0types.h:201