reactor-c
C Runtime for Lingua Franca
|
Implementations of functions in clock.h. More...
Functions | |
void | clock_sync_add_offset (instant_t *t) |
Add the current clock synchronization offset to a specified timestamp. | |
void | clock_sync_subtract_offset (instant_t *t) |
Subtract the clock synchronization offset from a timestamp. | |
int | lf_clock_gettime (instant_t *now) |
int | lf_clock_interruptable_sleep_until_locked (environment_t *env, instant_t wakeup_time) |
int | lf_clock_cond_timedwait (lf_cond_t *cond, instant_t wakeup_time) |
Implementations of functions in clock.h.
void clock_sync_add_offset | ( | instant_t * | t | ) |
Add the current clock synchronization offset to a specified timestamp.
t | Pointer to the timestamp to which to add the offset. |
void clock_sync_subtract_offset | ( | instant_t * | t | ) |
Subtract the clock synchronization offset from a timestamp.
t | The timestamp from which to subtract the current clock sync offset. |
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.