CUBRID Engine  latest
cubthread::daemon Class Reference

#include <thread_daemon.hpp>

Collaboration diagram for cubthread::daemon:
Collaboration graph

Public Member Functions

template<typename Context >
 daemon (const looper &loop_pattern_arg, context_manager< Context > *context_manager_arg, task< Context > *exec, const char *name)
 
 daemon (const looper &loop_pattern_arg, task_without_context *exec_arg, const char *name)
 
 ~daemon ()
 
void wakeup (void)
 
void stop_execution (void)
 
bool was_woken_up (void)
 
void reset_looper (void)
 
void get_stats (cubperf::stat_value *stats_out)
 
bool is_running (void)
 

Static Public Member Functions

static std::size_t get_stats_value_count (void)
 
static const char * get_stat_name (std::size_t stat_index)
 

Private Member Functions

void pause (void)
 
void register_stat_start (void)
 
void register_stat_pause (void)
 
void register_stat_execute (void)
 

Static Private Member Functions

template<typename Context >
static void loop_with_context (daemon *daemon_arg, context_manager< Context > *context_manager_arg, task< Context > *exec_arg, const char *name)
 
static void loop_without_context (daemon *daemon_arg, task_without_context *exec_arg, const char *name)
 
static cubperf::statsetcreate_statset (void)
 

Private Attributes

waiter m_waiter
 
looper m_looper
 
std::function< void(void)> m_func_on_stop
 
std::thread m_thread
 
std::string m_name
 
cubperf::statsetm_stats
 

Detailed Description

Definition at line 77 of file thread_daemon.hpp.

Constructor & Destructor Documentation

template<typename Context >
cubthread::daemon::daemon ( const looper loop_pattern_arg,
context_manager< Context > *  context_manager_arg,
task< Context > *  exec,
const char *  name 
)

Definition at line 150 of file thread_daemon.hpp.

References m_name, and m_thread.

cubthread::daemon::daemon ( const looper loop_pattern_arg,
task_without_context exec_arg,
const char *  name 
)

Definition at line 51 of file thread_daemon.cpp.

References loop_without_context(), m_name, and m_thread.

cubthread::daemon::~daemon ( )

Definition at line 62 of file thread_daemon.cpp.

References m_stats, and stop_execution().

Member Function Documentation

cubperf::statset & cubthread::daemon::create_statset ( void  )
staticprivate

Definition at line 178 of file thread_daemon.cpp.

References cubperf::statset_definition::create_statset().

std::size_t cubthread::daemon::get_stats_value_count ( void  )
static
bool cubthread::daemon::is_running ( void  )

Definition at line 136 of file thread_daemon.cpp.

References cubthread::waiter::is_running(), and m_waiter.

Referenced by dwb_file_sync_helper_daemon_is_running().

Here is the caller graph for this function:

template<typename Context >
void cubthread::daemon::loop_with_context ( daemon daemon_arg,
context_manager< Context > *  context_manager_arg,
task< Context > *  exec_arg,
const char *  name 
)
staticprivate
void cubthread::daemon::loop_without_context ( daemon daemon_arg,
task_without_context exec_arg,
const char *  name 
)
staticprivate
void cubthread::daemon::pause ( void  )
private

Definition at line 100 of file thread_daemon.cpp.

References m_looper, m_waiter, and cubthread::looper::put_to_sleep().

Referenced by loop_with_context(), and loop_without_context().

Here is the caller graph for this function:

void cubthread::daemon::register_stat_execute ( void  )
private

Definition at line 196 of file thread_daemon.cpp.

References m_stats, and cubperf::statset_definition::time_and_increment().

Referenced by loop_with_context(), and loop_without_context().

Here is the caller graph for this function:

void cubthread::daemon::register_stat_pause ( void  )
private

Definition at line 190 of file thread_daemon.cpp.

References m_stats, and cubperf::statset_definition::time().

Referenced by loop_with_context(), and loop_without_context().

Here is the caller graph for this function:

void cubthread::daemon::register_stat_start ( void  )
private

Definition at line 184 of file thread_daemon.cpp.

References m_stats, cubperf::generic_statset< IsAtomic >::m_timept, and cubperf::reset_timept().

Referenced by loop_with_context(), and loop_without_context().

Here is the caller graph for this function:

void cubthread::daemon::reset_looper ( void  )

Definition at line 112 of file thread_daemon.cpp.

References m_looper, and cubthread::looper::reset().

Referenced by pgbuf_get_page_flush_interval().

Here is the caller graph for this function:

void cubthread::daemon::stop_execution ( void  )

Definition at line 77 of file thread_daemon.cpp.

References m_func_on_stop, m_looper, m_thread, cubthread::looper::stop(), and wakeup().

Referenced by ~daemon().

Here is the caller graph for this function:

void cubthread::daemon::wakeup ( void  )
bool cubthread::daemon::was_woken_up ( void  )

Definition at line 106 of file thread_daemon.cpp.

References m_looper, and cubthread::looper::was_woken_up().

Referenced by pgbuf_get_page_flush_interval().

Here is the caller graph for this function:

Member Data Documentation

std::function<void (void)> cubthread::daemon::m_func_on_stop
private

Definition at line 135 of file thread_daemon.hpp.

Referenced by loop_with_context(), and stop_execution().

looper cubthread::daemon::m_looper
private
std::string cubthread::daemon::m_name
private

Definition at line 139 of file thread_daemon.hpp.

Referenced by daemon().

cubperf::statset& cubthread::daemon::m_stats
private
std::thread cubthread::daemon::m_thread
private

Definition at line 137 of file thread_daemon.hpp.

Referenced by daemon(), and stop_execution().

waiter cubthread::daemon::m_waiter
private

Definition at line 133 of file thread_daemon.hpp.

Referenced by get_stats(), is_running(), pause(), and wakeup().


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