src/c/scheduler.c
iot_scheduler_t * iot_scheduler_alloc (int priority, int affinity, iot_logger_t * logger)
{
  iot_scheduler_t * scheduler = (iot_scheduler_t*) calloc (1, sizeof (*scheduler));
  iot_component_init (&scheduler->component, IOT_SCHEDULER_FACTORY, (iot_component_start_fn_t) iot_scheduler_start, (iot_component_stop_fn_t) iot_scheduler_stop);
  scheduler->logger = logger;
  iot_logger_add_ref (logger);
  iot_log_info (logger, "iot_scheduler_alloc (priority: %d affinity: %d)", priority, affinity);
  iot_thread_create (NULL, iot_scheduler_thread, scheduler, priority, affinity, logger);
  return scheduler;
}
/* Initialise the schedule queue and processing thread */
Initialise the schedule queue and processing thread
Initialise the schedule queue and processing thread
iot_scheduler_t * iot_scheduler_alloc (int priority, int affinity, iot_logger_t * logger)
{
  iot_scheduler_t * scheduler = (iot_scheduler_t*) calloc (1, sizeof (*scheduler));
  iot_component_init (&scheduler->component, IOT_SCHEDULER_FACTORY, (iot_component_start_fn_t) iot_scheduler_start, (iot_component_stop_fn_t) iot_scheduler_stop);
  scheduler->logger = logger;
  iot_logger_add_ref (logger);
  iot_log_info (logger, "iot_scheduler_alloc (priority: %d affinity: %d)", priority, affinity);
  iot_thread_create (NULL, iot_scheduler_thread, scheduler, priority, affinity, logger);
  return scheduler;
}
iot_scheduler_t * iot_scheduler_alloc ( int priority , int affinity , iot_logger_t * logger ) { iot_scheduler_t * scheduler = ( iot_scheduler_t * ) calloc ( 1 , sizeof ( * scheduler ) ) ; iot_component_init ( & scheduler -> component , IOT_SCHEDULER_FACTORY , ( iot_component_start_fn_t ) iot_scheduler_start , ( iot_component_stop_fn_t ) iot_scheduler_stop ) ; scheduler -> logger = logger ; iot_logger_add_ref ( logger ) ; iot_log_info ( logger , " " , priority , affinity ) ; iot_thread_create ( NULL , iot_scheduler_thread , scheduler , priority , affinity , logger ) ; return scheduler ; }
Initialise the schedule queue and processing thread
Initialise the schedule queue and processing thread