| 1513 | } |
| 1514 | |
| 1515 | void hb_fifo_close( hb_fifo_t ** _f ) |
| 1516 | { |
| 1517 | hb_fifo_t * f = *_f; |
| 1518 | hb_buffer_t * b; |
| 1519 | |
| 1520 | if ( f == NULL ) |
| 1521 | return; |
| 1522 | |
| 1523 | hb_deep_log( 2, "fifo_close: trashing %d buffer(s)", hb_fifo_size( f ) ); |
| 1524 | while( ( b = hb_fifo_get( f ) ) ) |
| 1525 | { |
| 1526 | hb_buffer_close( &b ); |
| 1527 | } |
| 1528 | |
| 1529 | hb_lock_close( &f->lock ); |
| 1530 | hb_cond_close( &f->cond_empty ); |
| 1531 | hb_cond_close( &f->cond_full ); |
| 1532 | |
| 1533 | #if defined(HB_FIFO_DEBUG) |
| 1534 | // Remove the fifo from the global fifo list |
| 1535 | fifo_list_rem( f ); |
| 1536 | #endif |
| 1537 | |
| 1538 | free( f ); |
| 1539 | |
| 1540 | *_f = NULL; |
| 1541 | } |
| 1542 | |
| 1543 | void hb_fifo_flush( hb_fifo_t * f ) |
| 1544 | { |
no test coverage detected