42 #if !defined (WINDOWS) 55 #if !defined (NDEBUG) && defined (SERVER_MODE) 57 #else // RELEASE or !SERVER_MODE 59 #endif // RELEASE or !SERVER_MODE 84 , private_lru_index (-1)
87 , m_status (
status::TS_DEAD)
93 , xasl_unpack_info_ptr (
NULL)
95 , xasl_recursion_depth (0)
100 , request_fix_count (0)
101 , victim_request_fail (false)
102 , interrupted (false)
104 , check_interrupt (true)
105 , wait_for_latch_promote (false)
106 , next_wait_thrd (
NULL)
110 , lockwait_state (-1)
112 , tran_next_wait (
NULL)
113 , worker_thrd_list (
NULL)
119 , net_request_index (-1)
121 , sort_stats_active (false)
125 , clear_trace (false)
127 #
if !defined (NDEBUG)
128 , fi_test_array (
NULL)
129 , count_private_allocators (0)
132 , m_loaddb_driver (
NULL)
137 , m_alloc_tracker (*new
cubbase::
alloc_tracker (ALLOC_TRACK_NAME, ENABLE_TRACKERS, ALLOC_TRACK_MAX_ITEMS,
138 ALLOC_TRACK_RES_NAME))
139 , m_pgbuf_tracker (*new
cubbase::
pgbuf_tracker (PGBUF_TRACK_NAME, ENABLE_TRACKERS, PGBUF_TRACK_MAX_ITEMS,
140 PGBUF_TRACK_RES_NAME, PGBUF_TRACK_MAX_AMOUNT))
141 , m_csect_tracker (*new
cubsync::critical_section_tracker (ENABLE_TRACKERS))
168 gettimeofday (&t,
NULL);
170 srand48_r ((
long) t.tv_usec, &
rand_buf);
186 #if !defined (NDEBUG) 224 for (
int i = 0;
i < 3;
i++)
263 #if !defined (NDEBUG) 270 #if !defined (NDEBUG) 288 pthread_t thread_id = 0;
292 std::ostringstream oss;
294 thread_id = (pthread_t) std::stoul (oss.str ());
303 m_id = std::this_thread::get_id ();
305 #if defined (SERVER_MODE) 320 return m_id == std::this_thread::get_id ();
351 if (!ENABLE_TRACKERS)
365 if (!ENABLE_TRACKERS)
378 if (!ENABLE_TRACKERS)
443 const long ratio = 1000000;
446 tv.tv_usec += (long) usec.count ();
448 tv.tv_sec = tv.tv_usec /
ratio;
449 tv.tv_usec = tv.tv_usec %
ratio;
466 std::chrono::microseconds usecs;
477 start_time_pt = thread_clock_type::now ();
484 usecs = std::chrono::duration_cast<std::chrono::microseconds> (thread_clock_type::now () - start_time_pt);
525 if (r != 0 && r != ETIMEDOUT)
552 if (had_mutex ==
false)
560 if (had_mutex ==
false)
579 if (had_mutex ==
false)
657 pthread_cond_wait (&thread_p->
wakeup_cond, mutex_p);
661 r = pthread_cond_timedwait (&thread_p->
wakeup_cond, mutex_p, to);
668 if (timeout ==
INF_WAIT || r != ETIMEDOUT)
707 return "VACUUM_MASTER";
709 return "VACUUM_WORKER";
750 switch (resume_status)
753 return "RESUME_NONE";
755 return "RESUME_DUE_TO_INTERRUPT";
757 return "RESUME_DUE_TO_SHUTDOWN";
759 return "PGBUF_SUSPENDED";
761 return "PGBUF_RESUMED";
763 return "JOB_QUEUE_SUSPENDED";
765 return "JOB_QUEUE_RESUMED";
767 return "CSECT_READER_SUSPENDED";
769 return "CSECT_READER_RESUMED";
771 return "CSECT_WRITER_SUSPENDED";
773 return "CSECT_WRITER_RESUMED";
775 return "CSECT_PROMOTER_SUSPENDED";
777 return "CSECT_PROMOTER_RESUMED";
779 return "CSS_QUEUE_SUSPENDED";
781 return "CSS_QUEUE_RESUMED";
783 return "HEAP_CLSREPR_SUSPENDED";
785 return "HEAP_CLSREPR_RESUMED";
787 return "LOCK_SUSPENDED";
789 return "LOCK_RESUMED";
791 return "LOGWR_SUSPENDED";
793 return "LOGWR_RESUMED";
795 return "ALLOC_BCB_SUSPENDED";
797 return "ALLOC_BCB_RESUMED";
799 return "DWB_BLOCK_QUEUE_SUSPENDED";
801 return "DWB_BLOCK_QUEUE_RESUMED";
void return_lock_free_transaction_entries(void)
static LOG_ZIP * log_zip_redo
static const index INVALID_INDEX
const std::size_t PGBUF_TRACK_MAX_ITEMS
static void thread_timeval_add_usec(const std::chrono::microseconds &usec, struct timeval &tv)
void assign_lf_tran_index(lockfree::tran::index idx)
void pop_resource_tracks(void)
lf_tran_entry * tran_entries[THREAD_TS_COUNT]
void claim_system_worker()
#define ER_CSS_PTHREAD_COND_TIMEDOUT
#define pthread_mutex_init(a, b)
LF_TRAN_ENTRY * lf_tran_request_entry(LF_TRAN_SYSTEM *sys)
const int LOG_SYSTEM_TRAN_INDEX
static int log_data_length
LF_TRAN_SYSTEM sessions_Ts
#define pthread_mutex_unlock(a)
unsigned long int thread_id_t
void thread_wakeup_already_had_mutex(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason)
void push_resource_tracks(void)
static char * log_data_ptr
void thread_suspend_wakeup_and_unlock_entry(cubthread::entry *thread_p, thread_resume_suspend_status suspended_reason)
int fi_thread_final(THREAD_ENTRY *thread_p)
LF_TRAN_SYSTEM spage_saving_Ts
thread_resume_suspend_status resume_status
thread_resume_suspend_status
pthread_mutex_t th_entry_lock
#define ER_CSS_PTHREAD_COND_WAIT
struct log_zip * log_zip_undo
void db_destroy_private_heap(THREAD_ENTRY *thread_p, HL_HEAPID heap_id)
void request_lock_free_transactions(void)
LF_TRAN_SYSTEM obj_lock_ent_Ts
struct drand48_data rand_buf
struct timeval latch_waits
clock::time_point time_point
HL_HEAPID db_create_private_heap(void)
void lf_tran_return_entry(LF_TRAN_ENTRY *entry)
pthread_mutex_t tran_index_lock
static LOG_ZIP * log_zip_undo
std::chrono::system_clock thread_clock_type
HL_HEAPID private_heap_id
LF_TRAN_SYSTEM dwb_slots_Ts
void thread_check_suspend_reason_and_wakeup(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason, thread_resume_suspend_status suspend_reason)
void clear_resources(void)
bool is_on_current_thread() const
LF_TRAN_SYSTEM global_unique_stats_Ts
adj_array * cnv_adj_buffer[3]
lockfree::tran::index get_lf_tran_index()
cubbase::alloc_tracker & m_alloc_tracker
LF_TRAN_SYSTEM hfid_table_Ts
struct log_zip * log_zip_redo
void thread_lock_entry(cubthread::entry *thread_p)
LF_TRAN_SYSTEM catalog_Ts
void er_set_with_oserror(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
const char * PGBUF_TRACK_RES_NAME
#define ER_CSS_PTHREAD_COND_TIMEDWAIT
const char * PGBUF_TRACK_NAME
resource_tracker< const void * > alloc_tracker
static void error(const char *msg)
void thread_unlock_entry(cubthread::entry *thread_p)
const char * thread_resume_status_to_string(thread_resume_suspend_status resume_status)
static void thread_check_suspend_reason_and_wakeup_internal(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason, thread_resume_suspend_status suspend_reason, bool had_mutex)
lockfree::tran::index pull_lf_tran_index()
void log_zip_free(LOG_ZIP *log_zip)
pthread_cond_t wakeup_cond
log_system_tdes * m_systdes
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)
static void thread_wakeup_internal(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason, bool had_mutex)
int thread_suspend_timeout_wakeup_and_unlock_entry(cubthread::entry *thread_p, struct timespec *time_p, thread_resume_suspend_status suspended_reason)
void end_resource_tracks(void)
resource_tracker< const char * > pgbuf_tracker
HL_HEAPID private_heap_id
const char * ALLOC_TRACK_NAME
const unsigned PGBUF_TRACK_MAX_AMOUNT
cubbase::pgbuf_tracker & m_pgbuf_tracker
#define pthread_mutex_lock(a)
const char * thread_status_to_string(cubthread::entry::status status)
void thread_wakeup(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason)
const std::size_t ALLOC_TRACK_MAX_ITEMS
void retire_system_worker()
const char * ALLOC_TRACK_RES_NAME
static const bool ENABLE_TRACKERS
struct timeval lock_waits
lockfree::tran::index m_lf_tran_index
int fi_thread_init(THREAD_ENTRY *thread_p)
cubsync::critical_section_tracker & m_csect_tracker
LF_TRAN_SYSTEM free_sort_list_Ts
LF_TRAN_SYSTEM fpcache_Ts
const char * thread_type_to_string(thread_type type)
#define pthread_mutex_destroy(a)
void adj_ar_free(ADJ_ARRAY *adj_array_p)
LF_TRAN_SYSTEM obj_lock_res_Ts