20#ifndef REACTOR_COMMON_H
21#define REACTOR_COMMON_H
45#define MIN_SLEEP_DURATION USEC(10)
59#ifdef FEDERATED_DECENTRALIZED
API for the environment data structure.
Type definitions that are widely used across different parts of the runtime.
int trigger_handle_t
Definition lf_types.h:117
pqueue_pri_t index_t
Definition lf_types.h:132
Priority queue definitions for queues where the priority is a number that can be compared with ordina...
unsigned int _lf_number_of_workers
Definition reactor_common.c:78
void lf_recycle_event(environment_t *env, event_t *e)
Recycle the given event.
Definition reactor_common.c:454
void _lf_trigger_shutdown_reactions(environment_t *env)
Trigger all the shutdown reactions in the specified environment.
Definition reactor_common.c:436
void lf_set_default_command_line_options(void)
Generated function that optionally sets default command-line options.
Definition src_gen_stub.c:16
bool _lf_normal_termination
Definition reactor_common.c:1126
void lf_replace_token(event_t *event, lf_token_t *token)
Definition reactor_common.c:473
bool keepalive_specified
Definition reactor_common.c:88
void _lf_pop_events(environment_t *env)
Pop all events from event_q with tag equal to current tag.
Definition reactor_common.c:229
void initialize_global()
Initialize global variables and start tracing before calling the _lf_initialize_trigger_objects funct...
Definition reactor_common.c:1081
void _lf_advance_tag(environment_t *env, tag_t next_tag)
Definition reactor_common.c:642
void _lf_initialize_trigger_objects()
Definition src_gen_stub.c:14
void _lf_initialize_timers(environment_t *env)
Initialize all the timers in the environment.
Definition reactor_common.c:401
event_t * _lf_create_dummy_events(environment_t *env, tag_t tag)
Create a dummy event with the specified tag.
Definition reactor_common.c:465
void _lf_initialize_timer(environment_t *env, trigger_t *timer)
Initialize the given timer. If this timer has a zero offset, enqueue the reactions it triggers....
Definition reactor_common.c:354
index_t lf_combine_deadline_and_level(interval_t deadline, int level)
Combine a deadline and a level into a single index for sorting in the reaction queue.
Definition reactor_common.c:1224
void _lf_invoke_reaction(environment_t *env, reaction_t *reaction, int worker)
Definition reactor_common.c:684
instant_t duration
Definition reactor_common.c:85
int process_args(int argc, const char *argv[])
Definition reactor_common.c:910
bool fast
Definition reactor_common.c:68
trigger_handle_t _lf_schedule_at_tag(environment_t *env, trigger_t *trigger, tag_t tag, lf_token_t *token)
Schedule an event at a specific tag (time, microstep).
Definition reactor_common.c:482
void lf_free(struct allocation_record_t **head)
Free memory on the specified allocation record (a self struct).
Definition reactor_common.c:114
void termination(void)
Perform final wrap-up on exit.
Definition reactor_common.c:1132
int default_argc
Definition reactor_common.c:901
void _lf_start_time_step(environment_t *env)
Perform whatever is needed to start a time step.
Definition reactor_common.c:164
const char ** default_argv
Definition reactor_common.c:902
void schedule_output_reactions(environment_t *env, reaction_t *reaction, int worker)
Definition reactor_common.c:715
trigger_handle_t _lf_insert_reactions_for_trigger(environment_t *env, trigger_t *trigger, lf_token_t *token)
Insert reactions triggered by trigger to the reaction queue.
Definition reactor_common.c:562
event_t * lf_get_new_event(environment_t *env)
Definition reactor_common.c:339
void lf_create_environments(void)
Create and initialize the required number of environments for the program.
void _lf_trigger_reaction(environment_t *env, reaction_t *reaction, int worker_number)
Trigger the specified reaction on the specified worker in the specified environment.
Definition reactor_threaded.c:532
struct allocation_record_t * _lf_reactors_to_free
Definition reactor_common.c:110
void _lf_trigger_startup_reactions(environment_t *env)
Trigger all the startup reactions in the specified environment.
Definition reactor_common.c:417
void * worker(void *arg)
Definition reactor_threaded.c:875
void lf_terminate_execution(void)
Definition src_gen_stub.c:15
Definition lf_types.h:257
Execution environment. This struct contains information about the execution environment....
Definition environment.h:49
Definition lf_types.h:196
Definition lf_types.h:155
Definition lf_types.h:208
Time and tag definitions and functions for Lingua Franca.
int64_t instant_t
Definition tag.h:63
int64_t interval_t
Definition tag.h:68