reactor-c
C Runtime for Lingua Franca
|
Go to the source code of this file.
Macros | |
#define | LF_TIMEOUT 1 |
#define | DEPRECATED(X) X |
Typedefs | |
typedef struct environment_t | environment_t |
typedef void | lf_mutex_t |
Functions | |
int | lf_notify_of_event (environment_t *env) |
Notify of new event by calling the unthreaded platform API. | |
int | lf_critical_section_enter (environment_t *env) |
Enter critical section by disabling interrupts. | |
int | lf_critical_section_exit (environment_t *env) |
Leave a critical section by enabling interrupts. | |
void | _lf_initialize_clock (void) |
int | _lf_clock_now (instant_t *t) |
int | lf_sleep (interval_t sleep_duration) |
int | _lf_interruptable_sleep_until_locked (environment_t *env, instant_t wakeup_time) |
Sleep until the given wakeup time. Assumes the lock for the given environment is held. | |
DEPRECATED (int lf_nanosleep(interval_t sleep_duration)) | |
#define LF_TIMEOUT 1 |
Copyright (c) 2021, The University of California at Berkeley.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Platform API support for the C target of Lingua Franca. This file detects the platform on which the C compiler is being run (e.g. Windows, Linux, Mac) and conditionally includes platform-specific files that define core datatypes and function signatures for Lingua Franca.
Fetch the value of an internal (and platform-specific) physical clock and store it in t
.
Ideally, the underlying platform clock should be monotonic. However, the core lib tries to enforce monotonicity at higher level APIs (see tag.h).
Initialize the LF clock. Must be called before using other clock-related APIs.
int _lf_interruptable_sleep_until_locked | ( | environment_t * | env, |
instant_t | wakeup_time | ||
) |
Sleep until the given wakeup time. Assumes the lock for the given environment is held.
env | The environment within which to sleep. |
wakeup_time | The time instant at which to wake up. |
DEPRECATED | ( | int | lf_nanosleepinterval_t sleep_duration | ) |
int lf_critical_section_enter | ( | environment_t * | env | ) |
Enter critical section by disabling interrupts.
env | Environment in which we are executing. |
Enter a critical section where logical time and the event queue are guaranteed to not change unless they are changed within the critical section. this can be implemented by disabling interrupts. Users of this function must ensure that lf_init_critical_sections() is called first and that lf_critical_section_exit() is called later.
env | Ignored (present for compatibility). |
int lf_critical_section_exit | ( | environment_t * | env | ) |
Leave a critical section by enabling interrupts.
env | Environment in which we are executing. |
Exit the critical section entered with lf_lock_time().
env | Ignored (present for compatibility). |
int lf_notify_of_event | ( | environment_t * | env | ) |
Notify of new event by calling the unthreaded platform API.
env | Environment in which we are executing. |
int lf_sleep | ( | interval_t | sleep_duration | ) |
Pause execution for a given duration.