File:  [ELWIX - Embedded LightWeight unIX -] / libaitsched / example / test.c
Revision 1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Fri Aug 12 23:06:55 2011 UTC (12 years, 10 months ago) by misho
Branches: sched1_0
fix init pre-hook
add tailq init
import unit test

    1: #include <stdio.h>
    2: #include <aitsched.h>
    3: 
    4: void *event(void *arg)
    5: {
    6: 	return NULL;
    7: }
    8: 
    9: int
   10: main(int argc, char **argv)
   11: {
   12: 	sched_root_task_t *root;
   13: 
   14: 	root = schedBegin();
   15: 	if (!root) {
   16: 		printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
   17: 		return 1;
   18: 	}
   19: 
   20: 	if (!schedEvent(root, event, "piuk", 1234)) {
   21: 		printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError());
   22: 		return 2;
   23: 	}
   24: 
   25: 	schedEnd(root);
   26: 	return 0;
   27: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>