Created
September 10, 2012 09:30
-
-
Save dwfreed/3689915 to your computer and use it in GitHub Desktop.
Let's break libmowgli-2! \o/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include "mowgli.h" | |
void timer_one(void *unused){ | |
printf("timer_one\n"); | |
sleep(1); | |
} | |
void timer_two(void *unused){ | |
printf("timer_two\n"); | |
} | |
int main(int argc, char *argv[]){ | |
mowgli_eventloop_t *eventloop = mowgli_eventloop_create(); | |
mowgli_timer_add_once(eventloop, "timer_one", timer_one, NULL, 1); | |
mowgli_timer_add_once(eventloop, "timer_two", timer_two, NULL, 2); | |
mowgli_eventloop_run(eventloop); | |
mowgli_eventloop_destroy(eventloop); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment