CUBRID Engine
latest
|
#include <critical_section_tracker.hpp>
Classes | |
struct | cstrack_entry |
Public Member Functions | |
critical_section_tracker (bool enable=false) | |
void | start (void) |
void | stop (void) |
void | clear_all (void) |
void | on_enter_as_reader (int cs_index) |
void | on_enter_as_writer (int cs_index) |
void | on_promote (int cs_index) |
void | on_demote (int cs_index) |
void | on_exit (int cs_index) |
Static Public Attributes | |
static const std::size_t | MAX_REENTERS = 8 |
Private Member Functions | |
bool | is_started (void) |
void | check (void) |
void | check_csect_interdependencies (int cs_index) |
Private Attributes | |
cstrack_entry | m_cstrack_array [CRITICAL_SECTION_COUNT] |
bool | m_enabled |
std::uint8_t | m_start_count |
Definition at line 32 of file critical_section_tracker.hpp.
cubsync::critical_section_tracker::critical_section_tracker | ( | bool | enable = false | ) |
Definition at line 49 of file critical_section_tracker.cpp.
References m_enabled, and m_start_count.
|
private |
Definition at line 235 of file critical_section_tracker.cpp.
References CRITICAL_SECTION_COUNT, csect_name_at(), cubsync::cstrack_assert(), m_cstrack_array, cubsync::critical_section_tracker::cstrack_entry::m_enter_count, cubsync::critical_section_tracker::cstrack_entry::m_is_demoted, and cubsync::critical_section_tracker::cstrack_entry::m_is_writer.
Referenced by clear_all().
|
private |
Definition at line 186 of file critical_section_tracker.cpp.
References CSECT_CT_OID_TABLE, CSECT_LOCATOR_SR_CLASSNAME_TABLE, cubsync::cstrack_assert(), and m_cstrack_array.
Referenced by on_enter_as_reader(), and on_enter_as_writer().
void cubsync::critical_section_tracker::clear_all | ( | void | ) |
Definition at line 260 of file critical_section_tracker.cpp.
References check(), CRITICAL_SECTION_COUNT, m_cstrack_array, and m_start_count.
Referenced by cubthread::entry::end_resource_tracks(), and stop().
|
private |
Definition at line 195 of file critical_section_tracker.cpp.
References m_start_count.
Referenced by on_demote(), on_enter_as_reader(), on_enter_as_writer(), on_exit(), and on_promote().
void cubsync::critical_section_tracker::on_demote | ( | int | cs_index | ) |
Definition at line 144 of file critical_section_tracker.cpp.
References cubsync::cstrack_assert(), is_started(), m_cstrack_array, m_enabled, cubsync::critical_section_tracker::cstrack_entry::m_enter_count, cubsync::critical_section_tracker::cstrack_entry::m_is_demoted, and cubsync::critical_section_tracker::cstrack_entry::m_is_writer.
void cubsync::critical_section_tracker::on_enter_as_reader | ( | int | cs_index | ) |
Definition at line 58 of file critical_section_tracker.cpp.
References assert, check_csect_interdependencies(), cubsync::cstrack_assert(), is_started(), m_cstrack_array, m_enabled, cubsync::critical_section_tracker::cstrack_entry::m_enter_count, cubsync::critical_section_tracker::cstrack_entry::m_is_demoted, cubsync::critical_section_tracker::cstrack_entry::m_is_writer, and MAX_REENTERS.
void cubsync::critical_section_tracker::on_enter_as_writer | ( | int | cs_index | ) |
Definition at line 99 of file critical_section_tracker.cpp.
References check_csect_interdependencies(), cubsync::cstrack_assert(), is_started(), m_cstrack_array, m_enabled, cubsync::critical_section_tracker::cstrack_entry::m_enter_count, cubsync::critical_section_tracker::cstrack_entry::m_is_demoted, and cubsync::critical_section_tracker::cstrack_entry::m_is_writer.
void cubsync::critical_section_tracker::on_exit | ( | int | cs_index | ) |
Definition at line 162 of file critical_section_tracker.cpp.
References cubsync::cstrack_assert(), is_started(), m_cstrack_array, m_enabled, cubsync::critical_section_tracker::cstrack_entry::m_enter_count, cubsync::critical_section_tracker::cstrack_entry::m_is_demoted, and cubsync::critical_section_tracker::cstrack_entry::m_is_writer.
void cubsync::critical_section_tracker::on_promote | ( | int | cs_index | ) |
Definition at line 126 of file critical_section_tracker.cpp.
References cubsync::cstrack_assert(), is_started(), m_cstrack_array, m_enabled, cubsync::critical_section_tracker::cstrack_entry::m_enter_count, cubsync::critical_section_tracker::cstrack_entry::m_is_demoted, and cubsync::critical_section_tracker::cstrack_entry::m_is_writer.
void cubsync::critical_section_tracker::start | ( | void | ) |
Definition at line 201 of file critical_section_tracker.cpp.
References m_enabled, and m_start_count.
Referenced by cubthread::entry::push_resource_tracks().
void cubsync::critical_section_tracker::stop | ( | void | ) |
Definition at line 211 of file critical_section_tracker.cpp.
References clear_all(), cubsync::cstrack_assert(), m_enabled, and m_start_count.
Referenced by cubthread::entry::pop_resource_tracks().
|
private |
Definition at line 65 of file critical_section_tracker.hpp.
Referenced by check(), check_csect_interdependencies(), clear_all(), on_demote(), on_enter_as_reader(), on_enter_as_writer(), on_exit(), and on_promote().
|
private |
Definition at line 66 of file critical_section_tracker.hpp.
Referenced by critical_section_tracker(), on_demote(), on_enter_as_reader(), on_enter_as_writer(), on_exit(), on_promote(), start(), and stop().
|
private |
Definition at line 67 of file critical_section_tracker.hpp.
Referenced by clear_all(), critical_section_tracker(), is_started(), start(), and stop().
|
static |
Definition at line 38 of file critical_section_tracker.hpp.
Referenced by on_enter_as_reader().