reactor-c
C Runtime for Lingua Franca
|
A higher level API to the clock utilities provided by the platform API. More...
#include "low_level_platform.h"
Go to the source code of this file.
Functions | |
int | lf_clock_interruptable_sleep_until_locked (environment_t *env, instant_t wakeup_time) |
int | lf_clock_gettime (instant_t *now) |
int | lf_clock_cond_timedwait (lf_cond_t *cond, instant_t wakeup_time) |
A higher level API to the clock utilities provided by the platform API.
This builds on top of the clocking API of the different platforms and ensures:
Block the calling thread on the condition variable until it is signaled or until wakeup_time is reached. Before calling the appropriate function in the platform API, the wakeup_time will be translated into the correct timescale by removing any clock synchronization offset.
int lf_clock_gettime | ( | instant_t * | now | ) |
Retrieve the current physical time from the platform API. This adds any clock synchronization offset and guarantees monotonicity. Specifically, each returned value will be at least one nanosecond larger than any previously returned time.
now | A pointer to the location in which to store the result. |
int lf_clock_interruptable_sleep_until_locked | ( | environment_t * | env, |
instant_t | wakeup_time ) |
Block the calling thread until wakeup_time is reached or the thread is interrupted by an asynchronous scheduling. This is used by the single-threaded runtime. Before calling the appropriate function in the platform API, the wakeup_time will be translated into the correct timescale by removing any clock synchronization offset.