reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
scheduler_instance.c File Reference

Common scheduler functions. More...

#include <assert.h>
#include "scheduler_instance.h"
#include "environment.h"
#include "reactor.h"
#include "lf_types.h"
#include "util.h"

Functions

bool init_sched_instance (environment_t *env, lf_scheduler_t **instance, size_t number_of_workers, sched_params_t *params)
 Initialize instance using the provided information.
 

Detailed Description

Common scheduler functions.

Author
Soroush Bateni
Edward A. Lee

This file defines functions that are common across multiple schedulers.

Function Documentation

◆ init_sched_instance()

bool init_sched_instance ( struct environment_t * env,
lf_scheduler_t ** instance,
size_t number_of_workers,
sched_params_t * params )

Initialize instance using the provided information.

No-op if instance is already initialized (i.e., not NULL). This function assumes that mutex is allowed to be recursively locked.

Parameters
instanceThe lf_scheduler_t object to initialize.
number_of_workersNumber of workers in the program.
paramsReference to scheduler parameters in the form of a sched_params_t. Can be NULL.
Returns
true if initialization was performed. false if instance is already initialized (checked in a thread-safe way).