int main(int argc, char *argv[]) { TimerThread *timer; timer = timer_thread_create(1, 1, handle_alarm); timer_thread_start(timer); printf("Timer status: %s\n", get_timer_status_str(get_timer_status(timer))); while (count != 20) usleep(10); printf("Requesting timer stop\n"); timer_thread_stop(timer); printf("Timer status: %s\n", get_timer_status_string(get_timer_status(timer))); timer_thread_destroy(timer); return 0; }
ATF_TC_BODY(timer_thread_create_mono_expire, tc) { timer_thread_create(CLOCK_MONOTONIC, true); }
ATF_TC_BODY(timer_thread_create_real_expire, tc) { timer_thread_create(CLOCK_REALTIME, true); }
ATF_TC_BODY(timer_thread_create_mono, tc) { timer_thread_create(CLOCK_MONOTONIC, false); }
ATF_TC_BODY(timer_thread_create_real, tc) { timer_thread_create(CLOCK_REALTIME, false); }