#include <signalmanager.h>
Collaboration diagram for SMP::SMPSignalManager:
Public Member Functions | |
SMPSignalManager (SMPKernel *k) | |
~SMPSignalManager () | |
void | register_thread (int fid, pthread_t tid) |
at first, kernel should register to this manager about filters to watch for, so that the signal manager can know what to watch | |
void | start () |
void | stop (bool wait_handler) |
void | clear () |
void | monitor (int id) |
void | signal (int id) |
int | get_thread_id (int fid) |
int | get_filter_id (int id) |
void | set_timeout_f (int fid, int ms) |
int | get_timeout_f (int fid) |
Static Public Member Functions | |
static int | get_timeout (int id) |
SMP::SMPSignalManager::SMPSignalManager | ( | SMPKernel * | k | ) |
constructor
SMP::SMPSignalManager::~SMPSignalManager | ( | ) |
destructor
void SMP::SMPSignalManager::register_thread | ( | int | fid, | |
pthread_t | tid | |||
) |
at first, kernel should register to this manager about filters to watch for, so that the signal manager can know what to watch
fid | the filter to be watched, the filter should have signal-type input port implemented | |
tid | the thread id of the filter's signal_handler() thread |
void SMP::SMPSignalManager::start | ( | ) |
start the manager for watching, this will spawn as many watchdog threads as the number of signal_handler threads in SMP kernel
void SMP::SMPSignalManager::stop | ( | bool | wait_handler | ) |
stop the manager, which stops and kills all watchdog threads in the scope of the SMP execution
void SMP::SMPSignalManager::clear | ( | ) |
clear the vectors which stores information about the signal threads to watch
void SMP::SMPSignalManager::monitor | ( | int | id | ) |
this function is used to signal for start-of-watch of a signal_handler's execution
void SMP::SMPSignalManager::signal | ( | int | id | ) |
this function is used to signal for end-of-watch of a signal_handler's execution
int SMP::SMPSignalManager::get_thread_id | ( | int | fid | ) |
get the inner id of watchdog thread in signal manager, given the filter id defined in SMP kernel
int SMP::SMPSignalManager::get_filter_id | ( | int | id | ) | [inline] |
get the filter id defined in SMP kernel, given the inner id of watchdog thread in signal manager
void SMP::SMPSignalManager::set_timeout_f | ( | int | fid, | |
int | ms | |||
) | [inline] |
for filter to set its signal_handler watchdog's timeout value
int SMP::SMPSignalManager::get_timeout_f | ( | int | fid | ) | [inline] |
for filter to get the timeout value
int SMP::SMPSignalManager::get_timeout | ( | int | id | ) | [inline, static] |
for the monitor_thread (the watchdog) to get the timeout of a watchdog for a specific filter