CUBRID Engine
latest
|
#include "error_context.hpp"
#include "lockfree_transaction_def.hpp"
#include "porting.h"
#include "system.h"
#include <atomic>
#include <thread>
#include <cassert>
Go to the source code of this file.
Classes | |
class | cubbase::resource_tracker< Res > |
struct | event_stat |
class | cubthread::entry |
Namespaces | |
cubbase | |
cubsync | |
cubload | |
cubthread | |
Macros | |
#define | THREAD_TS_COUNT THREAD_TS_LAST |
Typedefs | |
using | cubbase::alloc_tracker = resource_tracker< const void * > |
using | cubbase::pgbuf_tracker = resource_tracker< const char * > |
typedef struct event_stat | EVENT_STAT |
typedef std::thread::id | thread_id_t |
typedef cubthread::entry | THREAD_ENTRY |
#define THREAD_TS_COUNT THREAD_TS_LAST |
Definition at line 93 of file thread_entry.hpp.
Referenced by cubthread::entry::clear_resources(), and cubthread::entry::return_lock_free_transaction_entries().
typedef struct event_stat EVENT_STAT |
Definition at line 98 of file thread_entry.hpp.
typedef cubthread::entry THREAD_ENTRY |
Definition at line 362 of file thread_entry.hpp.
typedef std::thread::id thread_id_t |
Definition at line 118 of file thread_entry.hpp.
anonymous enum |
Definition at line 78 of file thread_entry.hpp.
Definition at line 133 of file thread_entry.hpp.
enum thread_type |
Enumerator | |
---|---|
TT_MASTER | |
TT_SERVER | |
TT_WORKER | |
TT_DAEMON | |
TT_LOADDB | |
TT_VACUUM_MASTER | |
TT_VACUUM_WORKER | |
TT_NONE |
Definition at line 121 of file thread_entry.hpp.
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().
|
inline |
Definition at line 391 of file thread_entry.hpp.
References cubthread::entry::xasl_recursion_depth.
Referenced by css_set_thread_info().
|
inline |
Definition at line 385 of file thread_entry.hpp.
References cubthread::entry::xasl_recursion_depth.
Referenced by eval_pred(), fetch_peek_arith(), and qexec_execute_mainblock().
|
inline |
Definition at line 373 of file thread_entry.hpp.
References cubthread::entry::xasl_recursion_depth.
Referenced by eval_pred(), fetch_peek_arith(), qexec_execute_mainblock(), xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
|
inline |
Definition at line 427 of file thread_entry.hpp.
References cubthread::entry::sort_stats_active.
Referenced by pgbuf_claim_bcb_for_fix(), and pgbuf_copy_to_area().
|
inline |
Definition at line 379 of file thread_entry.hpp.
References cubthread::entry::xasl_recursion_depth.
Referenced by eval_pred(), fetch_peek_arith(), and qexec_execute_mainblock().
|
inline |
Definition at line 409 of file thread_entry.hpp.
References cubthread::entry::on_trace.
Referenced by qexec_execute_mainblock(), qexec_execute_mainblock_internal(), qexec_execute_query(), qexec_groupby(), qexec_groupby_index(), qexec_hash_gby_agg_tuple(), qexec_listfile_orderby(), qexec_orderby_distinct(), scan_get_index_oidset(), scan_next_index_scan(), scan_next_scan_local(), and scan_open_list_scan().
|
inline |
Definition at line 441 of file thread_entry.hpp.
References cubthread::entry::lock().
Referenced by css_free_wait_queue_entry(), css_queue_packet(), css_return_queued_data_timeout(), css_stop_non_log_writer(), dwb_set_status_resumed(), dwb_signal_waiting_thread(), dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), heap_classrepr_free(), lock_force_thread_timeout_lock(), lock_force_timeout_expired_wait_transactions(), lock_is_waiting_transaction(), logpb_flush_all_append_pages(), net_server_conn_down(), pgbuf_add_fixed_at(), pgbuf_allocate_bcb(), pgbuf_assign_direct_victim(), pgbuf_block_bcb(), thread_check_suspend_reason_and_wakeup_internal(), and thread_wakeup_internal().
|
inline |
Definition at line 421 of file thread_entry.hpp.
References cubthread::entry::clear_trace.
Referenced by qexec_execute_query(), and session_clear_trace_stats().
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().
|
inline |
Definition at line 415 of file thread_entry.hpp.
References cubregex::clear(), and cubthread::entry::clear_trace.
Referenced by session_clear_trace_stats(), and session_get_trace_stats().
|
inline |
Definition at line 433 of file thread_entry.hpp.
References cubthread::entry::sort_stats_active.
Referenced by sort_listfile().
|
inline |
Definition at line 403 of file thread_entry.hpp.
References cubthread::entry::trace_format.
Referenced by xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
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 * | p, |
struct timespec * | t, | ||
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 * | 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 * | p, |
pthread_mutex_t * | mutexp, | ||
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().
|
inline |
Definition at line 397 of file thread_entry.hpp.
References cubthread::entry::on_trace.
Referenced by xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
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().
|
inline |
Definition at line 447 of file thread_entry.hpp.
References p, thread_check_suspend_reason_and_wakeup(), thread_resume_status_to_string(), thread_status_to_string(), thread_suspend_timeout_wakeup_and_unlock_entry(), thread_suspend_wakeup_and_unlock_entry(), thread_suspend_with_other_mutex(), thread_type_to_string(), thread_wakeup(), thread_wakeup_already_had_mutex(), and cubthread::entry::unlock().
Referenced by css_free_wait_queue_entry(), css_queue_packet(), css_return_queued_data_timeout(), css_stop_non_log_writer(), dwb_set_status_resumed(), dwb_signal_waiting_thread(), dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), lock_force_thread_timeout_lock(), lock_force_timeout_expired_wait_transactions(), lock_is_waiting_transaction(), logpb_flush_all_append_pages(), net_server_conn_down(), pgbuf_add_fixed_at(), pgbuf_allocate_bcb(), pgbuf_assign_direct_victim(), pgbuf_block_bcb(), thread_check_suspend_reason_and_wakeup_internal(), and thread_wakeup_internal().
void thread_wakeup | ( | cubthread::entry * | 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 * | 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().