Skip to content

Instantly share code, notes, and snippets.

@dwfreed
Created September 10, 2012 09:30
Show Gist options
  • Save dwfreed/3689915 to your computer and use it in GitHub Desktop.
Save dwfreed/3689915 to your computer and use it in GitHub Desktop.
Let's break libmowgli-2! \o/
#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