CUBRID Engine  latest
cubthread::worker_pool< Context >::core::worker Class Reference

#include <thread_worker_pool.hpp>

Collaboration diagram for cubthread::worker_pool< Context >::core::worker:
Collaboration graph

Public Types

using core_type = typename worker_pool< Context >::core
 

Public Member Functions

 worker (void)
 
 ~worker (void)
 
void init_core (core_type &parent)
 
void assign_task (task< Context > *work_p, cubperf::time_point push_time)
 
void start_thread (void)
 
void push_task_on_running_thread (task< Context > *work_p, cubperf::time_point push_time)
 
void stop_execution (bool &is_not_stopped)
 
template<typename Func , typename... Args>
void map_context_if_running (bool &stop, Func &&func, Args &&...args)
 
void get_stats (cubperf::stat_value *sum_inout) const
 
std::mutexget_mutex (void)
 
bool has_thread (void)
 
void set_has_thread (void)
 
void set_push_time_now (void)
 

Private Member Functions

void run (void)
 
void init_run (void)
 
void finish_run (void)
 
void execute_current_task (void)
 
void retire_current_task (void)
 
bool get_new_task (void)
 

Private Attributes

core_typem_parent_core
 
Context * m_context_p
 
task_typem_task_p
 
std::condition_variable m_task_cv
 
std::mutex m_task_mutex
 
bool m_stop
 
bool m_has_thread
 
cubperf::statsetm_statistics
 
cubperf::time_point m_push_time
 

Detailed Description

template<typename Context>
class cubthread::worker_pool< Context >::core::worker

Definition at line 405 of file thread_worker_pool.hpp.

Member Typedef Documentation

template<typename Context>
using cubthread::worker_pool< Context >::core::worker::core_type = typename worker_pool<Context>::core

Definition at line 408 of file thread_worker_pool.hpp.

Constructor & Destructor Documentation

template<typename Context >
cubthread::worker_pool< Context >::core::worker::worker ( void  )

Definition at line 1119 of file thread_worker_pool.hpp.

template<typename Context >
cubthread::worker_pool< Context >::core::worker::~worker ( void  )

Member Function Documentation

template<typename Context>
std::mutex& cubthread::worker_pool< Context >::core::worker::get_mutex ( void  )
inline

Definition at line 436 of file thread_worker_pool.hpp.

template<typename Context >
void cubthread::worker_pool< Context >::core::worker::get_stats ( cubperf::stat_value sum_inout) const
template<typename Context>
bool cubthread::worker_pool< Context >::core::worker::has_thread ( void  )
inline

Definition at line 440 of file thread_worker_pool.hpp.

Referenced by cubthread::worker_pool< Context >::core::start_all_workers().

Here is the caller graph for this function:

template<typename Context >
void cubthread::worker_pool< Context >::core::worker::init_core ( core_type parent)

Definition at line 1141 of file thread_worker_pool.hpp.

References cubthread::worker_pool< Context >::core::worker::m_parent_core.

Referenced by cubthread::worker_pool< Context >::core::init_pool_and_workers().

Here is the caller graph for this function:

template<typename Context >
template<typename Func , typename... Args>
void cubthread::worker_pool< Context >::core::worker::map_context_if_running ( bool stop,
Func &&  func,
Args &&...  args 
)
template<typename Context>
void cubthread::worker_pool< Context >::core::worker::set_has_thread ( void  )
inline

Definition at line 444 of file thread_worker_pool.hpp.

Referenced by cubthread::worker_pool< Context >::core::start_all_workers().

Here is the caller graph for this function:

template<typename Context>
void cubthread::worker_pool< Context >::core::worker::set_push_time_now ( void  )
inline

Definition at line 448 of file thread_worker_pool.hpp.

Referenced by cubthread::worker_pool< Context >::core::start_all_workers().

Here is the caller graph for this function:

Member Data Documentation

template<typename Context>
bool cubthread::worker_pool< Context >::core::worker::m_stop
private

The documentation for this class was generated from the following file: