Lines Matching full:buffer
11 /* Circular buffer of integers. */
14 int buffer[BUFFER_SIZE]; /* the actual data */ member
15 pthread_mutex_t lock; /* mutex ensuring exclusive access to buffer */
17 pthread_cond_t notempty; /* signaled when buffer is not empty */
18 pthread_cond_t notfull; /* signaled when buffer is not full */
21 /* Initialize a buffer */
32 /* Store an integer in the buffer */
36 /* Wait until buffer is not full */ in put()
42 b->buffer[b->writepos] = data; in put()
45 /* Signal that the buffer is now not empty */ in put()
50 /* Read and remove an integer from the buffer */
56 /* Wait until buffer is not empty */ in get()
61 data = b->buffer[b->readpos]; in get()
64 /* Signal that the buffer is now not full */ in get()
75 struct prodcons buffer; variable
82 put(&buffer, n); in producer()
84 put(&buffer, OVER); in producer()
92 d = get(&buffer); in consumer()
104 init(&buffer); in libc_ex2()