Zero  0.1.0
Public Member Functions | Private Attributes | List of all members
checkpointer_t Class Reference

#include <daemons.h>

Inheritance diagram for checkpointer_t:
thread_t thread_wrapper_t

Public Member Functions

 checkpointer_t (ShoreEnv *env)
 
void set_active (bool active)
 
void work ()
 
- Public Member Functions inherited from thread_t
bool delete_me ()
 
std::string thread_name ()
 
randgen_trandgen ()
 Returns pointer to thread_t's randgen_t object. More...
 
int rand ()
 Returns a pseudo-random integer between 0 and RAND_MAX. More...
 
int rand (int n)
 
virtual ~thread_t ()
 
- Public Member Functions inherited from thread_wrapper_t
 thread_wrapper_t ()
 
virtual ~thread_wrapper_t ()
 
virtual void before_run ()
 
virtual void after_run ()
 
void spawn ()
 
void fork ()
 
void join ()
 

Private Attributes

ShoreEnv_env
 
bool _active
 

Additional Inherited Members

- Protected Member Functions inherited from thread_t
 thread_t (const std::string &name)
 
- Protected Attributes inherited from thread_t
bool _delete_me
 

Constructor & Destructor Documentation

§ checkpointer_t()

checkpointer_t::checkpointer_t ( ShoreEnv env)
inline

Member Function Documentation

§ set_active()

void checkpointer_t::set_active ( bool  active)
inline

§ work()

void checkpointer_t::work ( )
virtual

The previously used run() is already used by smthread core. Thus, run() now does the thread_t specific setup and calls work(). That is, work() is the new entry function for thread_t instead of run().

CS: sleep one second F times rather than sleeping F seconds. This allows to thread to finish after one second at most once it is deactivated.

Implements thread_t.

Member Data Documentation

§ _active

bool checkpointer_t::_active
private

§ _env

ShoreEnv* checkpointer_t::_env
private

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