| 1192 | } |
| 1193 | |
| 1194 | hb_fifo_t * hb_fifo_init( int capacity, int thresh ) |
| 1195 | { |
| 1196 | hb_fifo_t * f; |
| 1197 | f = calloc( sizeof( hb_fifo_t ), 1 ); |
| 1198 | f->lock = hb_lock_init(); |
| 1199 | f->cond_full = hb_cond_init(); |
| 1200 | f->cond_empty = hb_cond_init(); |
| 1201 | f->capacity = capacity; |
| 1202 | f->thresh = thresh; |
| 1203 | f->buffer_size = 0; |
| 1204 | |
| 1205 | #if defined(HB_FIFO_DEBUG) |
| 1206 | // Add the fifo to the global fifo list |
| 1207 | fifo_list_add( f ); |
| 1208 | #endif |
| 1209 | return f; |
| 1210 | } |
| 1211 | |
| 1212 | void hb_fifo_register_full_cond( hb_fifo_t * f, hb_cond_t * c ) |
| 1213 | { |
no test coverage detected