int main(int argc, char **argv) { if (nps_main_init(argc, argv)) { return 1; } if (nps_main.fg_host) { pthread_create(&th_flight_gear, NULL, nps_flight_gear_loop, NULL); } pthread_create(&th_display_ivy, NULL, nps_main_display, NULL); pthread_create(&th_main_loop, NULL, nps_main_loop, NULL); pthread_join(th_main_loop, NULL); return 0; }
int main ( int argc, char** argv) { if (!nps_main_parse_options(argc, argv)) return 1; nps_main_init(); signal(SIGCONT, cont_hdl); signal(SIGTSTP, tstp_hdl); printf("Time factor is %f. (Press Ctrl-Z to change)\n", nps_main.host_time_factor); GMainLoop *ml = g_main_loop_new(NULL, FALSE); g_timeout_add(HOST_TIMEOUT_MS, nps_main_periodic, NULL); g_main_loop_run(ml); return 0; }