aboutsummaryrefslogtreecommitdiff
path: root/broccoli/src/midbropasad.c
blob: 756e558db05a94785d4a25b7e84eda7a37fc0a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
}