MySQL 9.1.0
Source Code Documentation
|
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_t * | cells |
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... | |
Synchronization array.
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.
[in] | num_cells | Number of cells to create |
sync_array_t::~sync_array_t | ( | ) |
Destructor.
sync_cell_t* sync_array_t::cells |
pointer to wait array
ulint sync_array_t::first_free_slot |
the last slot that was freed
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.
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.
ulint sync_array_t::n_cells |
number of cells in the wait array
ulint sync_array_t::n_reserved |
number of currently reserved cells in the wait array
ulint sync_array_t::next_free_slot |
the next free cell in the array
ulint sync_array_t::res_count |
count of cell reservations since creation of the array