From cd393a04244181e73599b24ac38e70778501c120 Mon Sep 17 00:00:00 2001 From: Robert Gustafsson Date: Tue, 3 Oct 2017 09:14:55 +0200 Subject: Some refactoring --- broccoli/src/midbropasad.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 broccoli/src/midbropasad.c (limited to 'broccoli/src/midbropasad.c') diff --git a/broccoli/src/midbropasad.c b/broccoli/src/midbropasad.c new file mode 100644 index 0000000..756e558 --- /dev/null +++ b/broccoli/src/midbropasad.c @@ -0,0 +1,33 @@ +#include +#include +#include "fifoqueue.h" +#include "broevent.h" +#ifdef BROCCOLI +#include +#endif + + void +start_data_capture(Fifo_q * q) +{ + int res; + pthread_t event_listener; + res = pthread_create(&event_listener, NULL, bro_event_listener, q); + if(res){ + perror("Unable to create thread"); + exit(-1); + } +} + + int +main(int argc, char **argv) +{ + Fifo_q * q = init_queue(50); + start_data_capture(q); + while(true){ + printf("Main thread\n"); + sleep(10); + print_queue(q); + } + free(q); + return 0; +} -- cgit v1.2.3