| 224 | #endif |
| 225 | |
| 226 | void av_thread_message_flush(AVThreadMessageQueue *mq) |
| 227 | { |
| 228 | #if HAVE_THREADS |
| 229 | size_t used; |
| 230 | |
| 231 | pthread_mutex_lock(&mq->lock); |
| 232 | used = av_fifo_can_read(mq->fifo); |
| 233 | if (mq->free_func) |
| 234 | av_fifo_read_to_cb(mq->fifo, free_func_wrap, mq, &used); |
| 235 | /* only the senders need to be notified since the queue is empty and there |
| 236 | * is nothing to read */ |
| 237 | pthread_cond_broadcast(&mq->cond_send); |
| 238 | pthread_mutex_unlock(&mq->lock); |
| 239 | #endif /* HAVE_THREADS */ |
| 240 | } |