suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 1 | |
| 2 | /* Global definations */ |
| 3 | pthread_cond_t cv; |
| 4 | pthread_mutex_t lock; |
| 5 | |
| 6 | #define IND_USR_DAT_LEN 8 |
| 7 | #define IND_USR_DAT_VAL "brcmOLT" |
| 8 | #define BALCLIENT "bal_client" |
| 9 | #define BALSERVER "bal_server" |
| 10 | |
| 11 | /* A linked list (LL) node to store a queue entry */ |
| 12 | struct QNode |
| 13 | { |
| 14 | int obj_type; |
| 15 | int status; |
| 16 | struct QNode *next; |
| 17 | }; |
| 18 | |
| 19 | |
| 20 | /* The queue, front stores the front node of LL and rear stores ths |
| 21 | last node of LL */ |
| 22 | typedef struct Queue |
| 23 | { |
| 24 | struct QNode *front, *rear; |
| 25 | }bal_queue; |
| 26 | |
| 27 | /* shared queue */ |
| 28 | bal_queue *shared_queue; |
| 29 | |
| 30 | void create_stub_thread(); |
| 31 | bal_queue *createQueue(); |
| 32 | struct QNode* newNode(int objKey, int status); |
| 33 | void enQueue(int objKey, int status); |
| 34 | struct QNode *deQueue(); |