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

Function av_thread_message_queue_send_locked

libavutil/threadmessage.c:125–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123#if HAVE_THREADS
124
125static 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
142static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,
143 void *msg,

Callers 1

Calls 4

av_fifo_can_writeFunction · 0.85
av_fifo_writeFunction · 0.85
pthread_cond_waitFunction · 0.50
pthread_cond_signalFunction · 0.50

Tested by

no test coverage detected