MySQL 9.1.0
Source Code Documentation
sync_allowed_latches Struct Reference

Functor to check for given latching constraints. More...

#include <sync0types.h>

Inheritance diagram for sync_allowed_latches:
[legend]

Public Member Functions

 sync_allowed_latches (const latch_level_t *from, const latch_level_t *to)
 Constructor. More...
 
 sync_allowed_latches ()
 Default constructor. More...
 
virtual bool operator() (const latch_level_t level) override
 Check whether the given latch_t violates the latch constraint. More...
 
virtual bool result () const override
 
- Public Member Functions inherited from sync_check_functor_t
virtual ~sync_check_functor_t ()=default
 

Private Types

typedef std::vector< latch_level_t, ut::allocator< latch_level_t > > latches_t
 

Private Attributes

bool m_result
 Save the result of validation check here True if all OK. More...
 
latches_t m_latches
 List of latch levels that are allowed to be held. More...
 

Detailed Description

Functor to check for given latching constraints.

Member Typedef Documentation

◆ latches_t

Constructor & Destructor Documentation

◆ sync_allowed_latches() [1/2]

sync_allowed_latches::sync_allowed_latches ( const latch_level_t from,
const latch_level_t to 
)
inline

Constructor.

Parameters
[in]fromfirst element in an array of latch_level_t
[in]tolast element in an array of latch_level_t

◆ sync_allowed_latches() [2/2]

sync_allowed_latches::sync_allowed_latches ( )
inline

Default constructor.

The list of allowed latches is empty.

Member Function Documentation

◆ operator()()

virtual bool sync_allowed_latches::operator() ( const latch_level_t  level)
inlineoverridevirtual

Check whether the given latch_t violates the latch constraint.

This object maintains a list of allowed latch levels, and if the given latch belongs to a latch level that is not there in the allowed list, then it is a violation.

Parameters
[in]levelThe latch level to check
Returns
true if there is a latch ordering violation

Implements sync_check_functor_t.

◆ result()

virtual bool sync_allowed_latches::result ( ) const
inlineoverridevirtual
Returns
the result of the check

Implements sync_check_functor_t.

Member Data Documentation

◆ m_latches

latches_t sync_allowed_latches::m_latches
private

List of latch levels that are allowed to be held.

◆ m_result

bool sync_allowed_latches::m_result
private

Save the result of validation check here True if all OK.


The documentation for this struct was generated from the following file: