diff options
author | Robert Gustafsson <robg@student.chalmers.se> | 2017-10-03 09:14:55 +0200 |
---|---|---|
committer | Andreas Lindhé <andreas@lindhe.io> | 2017-10-09 12:14:35 +0200 |
commit | f4a7033d3629976f9980cb956e2c29315c6306c0 (patch) | |
tree | 9ef8d5193944f5b0f5e4f0f404cfcbd99cbeef43 /broccoli/src/midbropasad.c | |
parent | 1df374c02ae16e364cfa9bfab2aa4e7f8e52005e (diff) | |
download | midbro-f4a7033d3629976f9980cb956e2c29315c6306c0.tar.gz midbro-f4a7033d3629976f9980cb956e2c29315c6306c0.tar.bz2 |
Some refactoring
Diffstat (limited to 'broccoli/src/midbropasad.c')
-rw-r--r-- | broccoli/src/midbropasad.c | 33 |
1 files changed, 33 insertions, 0 deletions
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 <pthread.h> +#include <unistd.h> +#include "fifoqueue.h" +#include "broevent.h" +#ifdef BROCCOLI +#include <broccoli.h> +#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; +} |