MySQL 9.1.0
Source Code Documentation
sync_array_t Struct Reference

Synchronization array. More...

#include <sync0arr_impl.h>

Public Member Functions

 sync_array_t (ulint num_cells) 1
 Constructor Creates a synchronization wait array. More...
 
 ~sync_array_t () 1
 Destructor. More...
 

Public Attributes

ulint n_reserved
 number of currently reserved cells in the wait array More...
 
ulint n_cells
 number of cells in the wait array More...
 
sync_cell_tcells
 pointer to wait array More...
 
SysMutex mutex
 System mutex protecting the data structure. More...
 
ulint res_count
 count of cell reservations since creation of the array More...
 
ulint next_free_slot
 the next free cell in the array More...
 
ulint first_free_slot
 the last slot that was freed More...
 
uint64_t last_scan {0}
 It is incremented by one at the beginning of search for deadlock cycles, and then again after the scan has finished. More...
 

Detailed Description

Synchronization array.

Constructor & Destructor Documentation

◆ sync_array_t()

sync_array_t::sync_array_t ( ulint  num_cells)

Constructor Creates a synchronization wait array.

It is protected by a mutex which is automatically reserved when the functions operating on it are called.

Parameters
[in]num_cellsNumber of cells to create

◆ ~sync_array_t()

sync_array_t::~sync_array_t ( )

Destructor.

Member Data Documentation

◆ cells

sync_cell_t* sync_array_t::cells

pointer to wait array

◆ first_free_slot

ulint sync_array_t::first_free_slot

the last slot that was freed

◆ last_scan

uint64_t sync_array_t::last_scan {0}

It is incremented by one at the beginning of search for deadlock cycles, and then again after the scan has finished.

If during a scan we visit a cell with cell->last_scan == arr->last_scan it means it is already on the stack, and thus a cycle was found. If we visit a cell with cell->last_scan == arr->last_scan+1 it means it was already fully processed and no deadlock was found "below" it. If it has some other value, the cell wasn't visited by this scan before.

◆ mutex

SysMutex sync_array_t::mutex

System mutex protecting the data structure.

As this data structure is used in constructing the database mutex, to prevent infinite recursion in implementation, we fall back to an OS mutex.

◆ n_cells

ulint sync_array_t::n_cells

number of cells in the wait array

◆ n_reserved

ulint sync_array_t::n_reserved

number of currently reserved cells in the wait array

◆ next_free_slot

ulint sync_array_t::next_free_slot

the next free cell in the array

◆ res_count

ulint sync_array_t::res_count

count of cell reservations since creation of the array


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