| 123 | #if HAVE_THREADS |
| 124 | |
| 125 | static int av_thread_message_queue_send_locked(AVThreadMessageQueue *mq, |
| 126 | void *msg, |
| 127 | unsigned flags) |
| 128 | { |
| 129 | while (!mq->err_send && !av_fifo_can_write(mq->fifo)) { |
| 130 | if ((flags & AV_THREAD_MESSAGE_NONBLOCK)) |
| 131 | return AVERROR(EAGAIN); |
| 132 | pthread_cond_wait(&mq->cond_send, &mq->lock); |
| 133 | } |
| 134 | if (mq->err_send) |
| 135 | return mq->err_send; |
| 136 | av_fifo_write(mq->fifo, msg, 1); |
| 137 | /* one message is sent, signal one receiver */ |
| 138 | pthread_cond_signal(&mq->cond_recv); |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq, |
| 143 | void *msg, |
no test coverage detected