CUBRID Engine
latest
|
#include "thread_entry.hpp"
#include "adjustable_array.h"
#include "critical_section.h"
#include "critical_section_tracker.hpp"
#include "error_manager.h"
#include "fault_injection.h"
#include "list_file.h"
#include "lock_free.h"
#include "lockfree_transaction_system.hpp"
#include "log_compress.h"
#include "log_system_tran.hpp"
#include "memory_alloc.h"
#include "page_buffer.h"
#include "resource_tracker.hpp"
#include <cstring>
#include <sstream>
#include <pthread.h>
Go to the source code of this file.
Namespaces | |
cubthread | |
Typedefs | |
using | thread_clock_type = std::chrono::system_clock |
Variables | |
static const bool | cubthread::ENABLE_TRACKERS |
const char * | cubthread::ALLOC_TRACK_NAME = "Virtual Memory" |
const char * | cubthread::ALLOC_TRACK_RES_NAME = "res_ptr" |
const std::size_t | cubthread::ALLOC_TRACK_MAX_ITEMS = 32767 |
const char * | cubthread::PGBUF_TRACK_NAME = "Page Buffer" |
const char * | cubthread::PGBUF_TRACK_RES_NAME = "pgptr" |
const std::size_t | cubthread::PGBUF_TRACK_MAX_ITEMS = 1024 |
const unsigned | cubthread::PGBUF_TRACK_MAX_AMOUNT = 16 |
using thread_clock_type = std::chrono::system_clock |
Definition at line 430 of file thread_entry.cpp.
void thread_check_suspend_reason_and_wakeup | ( | cubthread::entry * | thread_p, |
thread_resume_suspend_status | resume_reason, | ||
thread_resume_suspend_status | suspend_reason | ||
) |
Definition at line 610 of file thread_entry.cpp.
References thread_check_suspend_reason_and_wakeup_internal().
Referenced by css_stop_log_writer(), and thread_unlock_entry().
|
static |
Definition at line 575 of file thread_entry.cpp.
References cubthread::entry::resume_status, thread_lock_entry(), thread_unlock_entry(), and cubthread::entry::wakeup_cond.
Referenced by thread_check_suspend_reason_and_wakeup().
const char* thread_resume_status_to_string | ( | thread_resume_suspend_status | resume_status | ) |
Definition at line 748 of file thread_entry.cpp.
References THREAD_ALLOC_BCB_RESUMED, THREAD_ALLOC_BCB_SUSPENDED, THREAD_CSECT_PROMOTER_RESUMED, THREAD_CSECT_PROMOTER_SUSPENDED, THREAD_CSECT_READER_RESUMED, THREAD_CSECT_READER_SUSPENDED, THREAD_CSECT_WRITER_RESUMED, THREAD_CSECT_WRITER_SUSPENDED, THREAD_CSS_QUEUE_RESUMED, THREAD_CSS_QUEUE_SUSPENDED, THREAD_DWB_QUEUE_RESUMED, THREAD_DWB_QUEUE_SUSPENDED, THREAD_HEAP_CLSREPR_RESUMED, THREAD_HEAP_CLSREPR_SUSPENDED, THREAD_JOB_QUEUE_RESUMED, THREAD_JOB_QUEUE_SUSPENDED, THREAD_LOCK_RESUMED, THREAD_LOCK_SUSPENDED, THREAD_LOGWR_RESUMED, THREAD_LOGWR_SUSPENDED, THREAD_PGBUF_RESUMED, THREAD_PGBUF_SUSPENDED, THREAD_RESUME_DUE_TO_INTERRUPT, THREAD_RESUME_DUE_TO_SHUTDOWN, and THREAD_RESUME_NONE.
Referenced by showstmt_array_end_scan(), and thread_unlock_entry().
const char* thread_status_to_string | ( | cubthread::entry::status | status | ) |
Definition at line 723 of file thread_entry.cpp.
References cubthread::entry::TS_CHECK, cubthread::entry::TS_DEAD, cubthread::entry::TS_FREE, cubthread::entry::TS_RUN, and cubthread::entry::TS_WAIT.
Referenced by showstmt_array_end_scan(), and thread_unlock_entry().
int thread_suspend_timeout_wakeup_and_unlock_entry | ( | cubthread::entry * | thread_p, |
struct timespec * | time_p, | ||
thread_resume_suspend_status | suspended_reason | ||
) |
Definition at line 509 of file thread_entry.cpp.
References ARG_FILE_LINE, assert, ER_CSS_PTHREAD_COND_TIMEDOUT, ER_CSS_PTHREAD_COND_TIMEDWAIT, ER_ERROR_SEVERITY, er_set_with_oserror(), error(), cubthread::entry::m_status, NO_ERROR, pthread_mutex_unlock, cubthread::entry::resume_status, cubthread::entry::th_entry_lock, cubthread::entry::TS_CHECK, cubthread::entry::TS_RUN, cubthread::entry::TS_WAIT, and cubthread::entry::wakeup_cond.
Referenced by css_return_queued_data_timeout(), dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), pgbuf_allocate_bcb(), and thread_unlock_entry().
void thread_suspend_wakeup_and_unlock_entry | ( | cubthread::entry * | thread_p, |
thread_resume_suspend_status | suspended_reason | ||
) |
Definition at line 461 of file thread_entry.cpp.
References assert, cubthread::entry::event_stats, event_stat::latch_waits, event_stat::lock_waits, cubthread::entry::m_status, pthread_mutex_unlock, cubthread::entry::resume_status, cubthread::entry::th_entry_lock, THREAD_LOCK_SUSPENDED, THREAD_PGBUF_SUSPENDED, thread_timeval_add_usec(), event_stat::trace_slow_query, cubthread::entry::TS_CHECK, cubthread::entry::TS_RUN, cubthread::entry::TS_WAIT, and cubthread::entry::wakeup_cond.
Referenced by css_return_queued_data_timeout(), heap_classrepr_free(), pgbuf_add_fixed_at(), pgbuf_block_bcb(), and thread_unlock_entry().
int thread_suspend_with_other_mutex | ( | cubthread::entry * | thread_p, |
pthread_mutex_t * | mutex_p, | ||
int | timeout, | ||
struct timespec * | to, | ||
thread_resume_suspend_status | suspended_reason | ||
) |
Definition at line 638 of file thread_entry.cpp.
References ARG_FILE_LINE, assert, ER_CSS_PTHREAD_COND_TIMEDOUT, ER_CSS_PTHREAD_COND_WAIT, ER_ERROR_SEVERITY, er_set_with_oserror(), error(), INF_WAIT, cubthread::entry::m_status, NO_ERROR, NULL, pthread_mutex_lock, pthread_mutex_unlock, cubthread::entry::resume_status, cubthread::entry::th_entry_lock, cubthread::entry::TS_WAIT, and cubthread::entry::wakeup_cond.
Referenced by csect_wait_on_promoter_queue(), csect_wait_on_writer_queue(), logwr_log_ha_filestat_to_string(), and thread_unlock_entry().
|
static |
Definition at line 441 of file thread_entry.cpp.
References ratio.
Referenced by thread_suspend_wakeup_and_unlock_entry().
const char* thread_type_to_string | ( | thread_type | type | ) |
Definition at line 692 of file thread_entry.cpp.
References TT_DAEMON, TT_LOADDB, TT_MASTER, TT_NONE, TT_SERVER, TT_VACUUM_MASTER, TT_VACUUM_WORKER, and TT_WORKER.
Referenced by showstmt_array_end_scan(), and thread_unlock_entry().
void thread_wakeup | ( | cubthread::entry * | thread_p, |
thread_resume_suspend_status | resume_reason | ||
) |
Definition at line 604 of file thread_entry.cpp.
References thread_wakeup_internal().
Referenced by csect_wakeup_waiting_promoter(), csect_wakeup_waiting_writer(), heap_classrepr_free(), logtb_find_thread_by_tran_index_except_me(), and thread_unlock_entry().
void thread_wakeup_already_had_mutex | ( | cubthread::entry * | thread_p, |
thread_resume_suspend_status | resume_reason | ||
) |
Definition at line 623 of file thread_entry.cpp.
References thread_wakeup_internal().
Referenced by css_free_wait_queue_entry(), css_queue_packet(), css_stop_non_log_writer(), dwb_signal_waiting_thread(), logpb_flush_all_append_pages(), net_server_conn_down(), pgbuf_assign_direct_victim(), and thread_unlock_entry().
|
static |
Definition at line 550 of file thread_entry.cpp.
References cubthread::entry::resume_status, thread_lock_entry(), thread_unlock_entry(), and cubthread::entry::wakeup_cond.
Referenced by thread_wakeup(), and thread_wakeup_already_had_mutex().