53 std::function<
bool(
const lock_t &)> visitor);
72 const std::function<
void(
const lock_t &
lock)> &f);
116 template <
typename F>
124 template <
typename F>
Iterates over all locks in the lock sys in a manner which guarantees that all locks from the same loc...
Definition: lock0iter.h:57
std::vector< table_id_t > m_table_ids
List of ids of all tables found in dict sys which are candidates for inspection in TABLE_LOCKS stage.
Definition: lock0iter.h:98
bool iterate_over_current_cell(struct Locks_hashtable &hash_table, F &&f)
Helper function for PRDT_PAGE_LOCKS, PRDT_LOCKS and REC_LOCKS stages.
Definition: lock0iter.cc:66
bool iterate_over_current_table(F &&f)
Helper function for TABLE_LOCKS stage.
Definition: lock0iter.cc:45
stage_t m_stage
The current stage this iterator is in.
Definition: lock0iter.h:94
size_t m_bucket_id
Tracks progress within a single stage: index of table in m_table_ids for the TABLE_LOCKS stage,...
Definition: lock0iter.h:103
bool iterate_over_next_batch(const std::function< void(const lock_t &lock)> &f)
Processes a batch of one or more non-empty lock queues, calling the provided function f for each lock...
Definition: lock0iter.cc:121
stage_t
This iterator moves through the following stages, where the move to next stage occurs when all locks ...
Definition: lock0iter.h:77
@ NOT_STARTED
iterator was just created (which does not cost much)
@ DONE
finished iterating, nothing more to see
@ TABLE_LOCKS
iterating over LOCK_TABLE locks for tables from m_table_ids
@ PRDT_LOCKS
iterating over LOCK_PREDICATE locks in lock_sys->prdt_hash
@ REC_LOCKS
iterating over other (non-predicate) LOCK_RECORD locks in lock_sys->rec_hash
@ PRDT_PAGE_LOCKS
iterating over LOCK_PRDT_PAGE in lock_sys->prdt_page_hash
uint32_t m_lock_sys_n_resizes_at_the_beginning
The value of lock_sys->n_resizes is stored in this field at the begging of stages involving iterating...
Definition: lock0iter.h:109
Data dictionary global types.
The transaction lock system global types.
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
Definition: lock0guards.h:34
const lock_t * find_blockers(const lock_t &wait_lock, std::function< bool(const lock_t &)> visitor)
Calls visitor for each lock_t object which is a reason that wait_lock has to wait.
Definition: lock0iter.cc:191
A hashmap used by lock sys, to organize locks by page (block), so that it is easy to maintain a list ...
Definition: lock0lock.h:1008
Lock struct; protected by lock_sys latches.
Definition: lock0priv.h:137
Version control for database, common definitions, and include files.