/* main */ int main(void) { /* initialise kernel */ si_kernel_init(); /* initialise UI channel */ si_ui_init(); /* initialise display */ display_init(); /* initialise variables */ clock_init(); /* create tasks */ si_task_create(clock_task, &Clock_Stack[STACK_SIZE-1], 20); si_task_create(alarm_task, &Alarm_Stack[STACK_SIZE-1],17); si_task_create(set_task, &Set_Stack[STACK_SIZE-1], 15); /* start the kernel */ si_kernel_start(); /* will never be here! */ return 0; }
int main(void) { /* initialise kernel */ si_kernel_init(); /* initialise message handling */ si_message_init(); /* set up random number generator */ srand(12345); /* initialise UI channel */ si_ui_init(); /* set size of GUI window */ si_ui_set_size(670, 700); /* initialise variables */ mainlift=lift_create(); /* create tasks */ si_task_create(lift_task, &Lift_Stack[STACK_SIZE-1], 20); si_task_create(user_task, &User_Stack[STACK_SIZE-1], 15); /* start the kernel */ si_kernel_start(); /* will never be here! */ return 0; }
int main(void) { /* initialise kernel */ si_kernel_init(); /* initialise UI channel */ si_ui_init(); /* initialise semaphore */ si_sem_init(&Mutex, 1); /* create tasks */ si_task_create(display_task, &Display_Stack[STACK_SIZE - 1], 10); si_task_create(change_task, &Change_Stack[STACK_SIZE - 1], 20); si_task_create(exit_task, &Exit_Stack[STACK_SIZE - 1], 15); /* start the kernel */ si_kernel_start(); /* will never be here! */ return 0; }
int main(void) { /* initialise kernel */ si_kernel_init(); /* initialise message handling */ si_message_init(); /* set up random number generator */ srand(12345); /* initialise UI channel */ si_ui_init(); /* set size of GUI window */ si_ui_set_size(670, 700); /* initialise variables */ lift_init(mainlift); /* create tasks */ /* create tasks */ si_task_create( lift_task, &Lift_Stack[STACK_SIZE - 1], LIFT_PRIORITY); Lift_Task_Id = 1; si_task_create( move_lift_task, &Move_Lift_Stack[STACK_SIZE - 1], MOVE_LIFT_PRIORITY); Move_Lift_Task_Id = 2; si_task_create( user_task, &User_Stack[STACK_SIZE - 1], USER_PRIORITY); User_Task_Id = 3; Lowest_Passenger_Task_Id = TASK_ID_FIRST_PERSON; /* start the kernel */ si_kernel_start(); /* will never be here! */ return 0; }
int main(int argc, char **argv) { message_init(); si_ui_init(); // Initialize user interface. (Must be done here!) lift_pid = fork(); if(!lift_pid) { lift_process(); } uidraw_pid = fork(); if(!uidraw_pid) { uidraw_process(); } liftmove_pid = fork(); if(!liftmove_pid) { liftmove_process(); } uicommand_process(); return 0; }
int main(int argc, char **argv) { int i; int current_person_id = 0; int pid; printf("Length of time_msg: %lld \n", sizeof(struct long_time_msg)); message_init(); si_ui_init(); // Initialize user interface. (Must be done here!) lift_pid = fork(); if(!lift_pid) { lift_process(); } uidraw_pid = fork(); if(!uidraw_pid) { uidraw_process(); } liftmove_pid = fork(); if(!liftmove_pid) { liftmove_process(); } guard_pid = fork(); if(!guard_pid) { file_guard_process(); } for (i=0; i<MAX_N_PERSONS; i++) { if (current_person_id < MAX_N_PERSONS) { pid = fork(); if (!pid) { person_process(current_person_id); } else { person_pid[current_person_id++] = pid; } } } uicommand_process(); return 0; }
/* main */ int main(void) { /* initialise UI channel */ si_ui_init(); /* initialise variables */ clock_init(); /* create tasks */ pthread_t clock_thread_handle; pthread_t alarm_thread_handle; pthread_t set_thread_handle; pthread_create(&clock_thread_handle, NULL, clock_thread, 0); pthread_create(&alarm_thread_handle, NULL, alarm_thread, 0); pthread_create(&set_thread_handle, NULL, set_thread, 0); pthread_join(clock_thread_handle, NULL); pthread_join(alarm_thread_handle, NULL); pthread_join(set_thread_handle, NULL); /* will never be here! */ return 0; }