view example/renew_task/main.cc @ 224:ebfb9e389716

SceneGraph.cpp xmlcreate
author tkaito@nw0534.st.ie.u-ryukyu.ac.jp
date Tue, 10 Feb 2009 20:45:51 +0900
parents 4f5c64e713c7
children af07173af3f4
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "TaskManager.h"
#include "Func.h"

extern void task_init(void);

const char *help_str = "Usage: ./renew_task";

static int
init(int argc, char **argv)
{
    for (int i = 1; argv[i]; ++i) {
        if (strcmp(argv[i], "--help") == 0) {
            printf("%s\n", help_str);
            return -1;
        }
    }

    return 0;
}

static void
renew_init(void)
{
    HTask *renew;

    printf("[PPE] Create Task : RenewStart\n\n");

    renew = manager->create_task(RENEW_START);
    renew->set_cpu(SPE_ANY);

    // add Active Queue
    renew->spawn();    
}

int
cerium_main(int argc, char *argv[])
{
    if (init(argc, argv) < 0) {
	return -1;
    }

    // Task Register
    //   ppe/task_init.cc
    task_init();

    printf("[PPE] Program Start\n\n");

    renew_init();

    return 0;
}