scheduler.c

Basic task scheduling library
git clone git://git.finwo.net/lib/scheduler.c
Log | Files | Refs | README | LICENSE

example_basic.c (271B)


      1 #include <stdio.h>
      2 #include <stdlib.h>
      3 
      4 #include "src/scheduler.h"
      5 
      6 static int greet(int64_t ts, pt_task_t *task) {
      7   (void)ts;
      8   (void)task;
      9   printf("Hello, world!\n");
     10   return SCHED_DONE;
     11 }
     12 
     13 int main(void) {
     14   sched_create(greet, NULL);
     15   sched_main();
     16   return 0;
     17 }