reactor-c
C Runtime for Lingua Franca
|
Definitions for watchdogs. More...
#include <assert.h>
#include "watchdog.h"
#include "environment.h"
#include "util.h"
#include "clock.h"
Functions | |
void | _lf_initialize_watchdogs (environment_t *env) |
Initialize watchdog mutexes. For any reactor with one or more watchdogs, the self struct should have a non-NULL reactor_mutex field which points to an instance of lf_mutex_t . This function initializes those mutexes. It also initializes the condition variable which enables the safe termination of a running watchdog. Finally it starts of a non-termminating thread for each watchdog. | |
void | _lf_watchdog_terminate_all (environment_t *env) |
Terminate all watchdog threads. | |
void | watchdog_wait (watchdog_t *watchdog) |
void | lf_watchdog_start (watchdog_t *watchdog, interval_t additional_timeout) |
Start or restart the watchdog timer. | |
void | lf_watchdog_stop (watchdog_t *watchdog) |
Stop the specified watchdog without invoking the expiration handler. This function sets the expiration time of the watchdog to NEVER . | |
Definitions for watchdogs.
void _lf_initialize_watchdogs | ( | environment_t * | env | ) |
Initialize watchdog mutexes. For any reactor with one or more watchdogs, the self struct should have a non-NULL reactor_mutex
field which points to an instance of lf_mutex_t
. This function initializes those mutexes. It also initializes the condition variable which enables the safe termination of a running watchdog. Finally it starts of a non-termminating thread for each watchdog.
void _lf_watchdog_terminate_all | ( | environment_t * | env | ) |
Terminate all watchdog threads.
void lf_watchdog_start | ( | watchdog_t * | watchdog, |
interval_t | additional_timeout ) |
Start or restart the watchdog timer.
This function sets the expiration time of the watchdog to the current logical time plus the minimum timeout of the watchdog plus the specified additional_timeout
. This function assumes the reactor mutex is held when it is called; this assumption is satisfied whenever this function is called from within a reaction that declares the watchdog as an effect.
watchdog | The watchdog to be started |
additional_timeout | Additional timeout to be added to the watchdog's minimum expiration. |
void lf_watchdog_stop | ( | watchdog_t * | watchdog | ) |
Stop the specified watchdog without invoking the expiration handler. This function sets the expiration time of the watchdog to NEVER
.
watchdog | The watchdog. |
void watchdog_wait | ( | watchdog_t * | watchdog | ) |