| 140 | } |
| 141 | |
| 142 | static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq, |
| 143 | void *msg, |
| 144 | unsigned flags) |
| 145 | { |
| 146 | while (!mq->err_recv && !av_fifo_can_read(mq->fifo)) { |
| 147 | if ((flags & AV_THREAD_MESSAGE_NONBLOCK)) |
| 148 | return AVERROR(EAGAIN); |
| 149 | pthread_cond_wait(&mq->cond_recv, &mq->lock); |
| 150 | } |
| 151 | if (!av_fifo_can_read(mq->fifo)) |
| 152 | return mq->err_recv; |
| 153 | av_fifo_read(mq->fifo, msg, 1); |
| 154 | /* one message space appeared, signal one sender */ |
| 155 | pthread_cond_signal(&mq->cond_send); |
| 156 | return 0; |
| 157 | } |
| 158 | |
| 159 | #endif /* HAVE_THREADS */ |
| 160 |
no test coverage detected