Worker thread for thread_per_block runtime. More...
#include <mb_worker.h>
Public Types | |
enum | worker_state_t { TS_UNINITIALIZED, TS_RUNNING, TS_DEAD } |
worker thread states More... | |
enum | cause_of_death_t { RIP_NOT_DEAD_YET, RIP_EXIT, RIP_TERMINATE, RIP_CTOR_EXCEPTION, RIP_INIT_EXCEPTION, RIP_UNHANDLED_EXCEPTION } |
why we're dead More... | |
Public Member Functions | |
mb_worker (mb_runtime_thread_per_block *runtime, mb_mblock_maker_t maker, const std::string &instance_name, pmt_t user_arg) | |
void | worker_thread_top_level () |
This code runs as the top-level of the new thread. | |
void * | run_undetached (void *arg) |
Invokes the top-level of the new thread (name kind of sucks). | |
Public Attributes | |
mb_runtime_thread_per_block * | d_runtime |
mb_mblock_maker_t | d_maker |
std::string | d_instance_name |
pmt_t | d_user_arg |
mb_mblock_sptr | d_mblock |
omni_mutex | d_mutex |
General mutex for all these fields. | |
omni_condition | d_state_cond |
worker_state_t | d_state |
cause_of_death_t | d_why_dead |
Worker thread for thread_per_block runtime.
mb_worker::mb_worker | ( | mb_runtime_thread_per_block * | runtime, | |
mb_mblock_maker_t | maker, | |||
const std::string & | instance_name, | |||
pmt_t | user_arg | |||
) |
void* mb_worker::run_undetached | ( | void * | arg | ) | [virtual] |
Invokes the top-level of the new thread (name kind of sucks).
Reimplemented from omni_thread.
void mb_worker::worker_thread_top_level | ( | ) |
This code runs as the top-level of the new thread.
std::string mb_worker::d_instance_name |
General mutex for all these fields.
They are accessed by both the main runtime thread and the newly created thread that runs the mblock's main loop.