| 29 | /* Initialize a buffer */ |
| 30 | |
| 31 | static void init(struct prodcons * b) |
| 32 | { |
| 33 | pthread_mutex_init(&b->lock, NULL); |
| 34 | pthread_cond_init(&b->notempty, NULL); |
| 35 | pthread_cond_init(&b->notfull, NULL); |
| 36 | b->readpos = 0; |
| 37 | b->writepos = 0; |
| 38 | } |
| 39 | |
| 40 | /* Store an integer in the buffer */ |
| 41 | static void put(struct prodcons * b, int data) |
no test coverage detected