MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_thread_message_queue_recv_locked

Function av_thread_message_queue_recv_locked

libavutil/threadmessage.c:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142static 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

Callers 1

Calls 4

av_fifo_can_readFunction · 0.85
av_fifo_readFunction · 0.85
pthread_cond_waitFunction · 0.50
pthread_cond_signalFunction · 0.50

Tested by

no test coverage detected