\hypertarget{group__Eina__Thread__Queue__Group}{}\doxysection{Thread Queue Group}
\label{group__Eina__Thread__Queue__Group}\index{Thread Queue Group@{Thread Queue Group}}


These functions provide simple zero-\/copy message queues for threads.  


\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct__Eina__Thread__Queue__Msg}{\+\_\+\+Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg}}
\item 
struct \mbox{\hyperlink{struct__Eina__Thread__Queue__Msg__Sub}{\+\_\+\+Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg\+\_\+\+Sub}}
\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \+\_\+\+Eina\+\_\+\+Thread\+\_\+\+Queue \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}}
\item 
typedef struct \mbox{\hyperlink{struct__Eina__Thread__Queue__Msg}{\+\_\+\+Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg}} \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga691263b2be42e2b5671448f275687eb5}{Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg}}
\item 
typedef struct \mbox{\hyperlink{struct__Eina__Thread__Queue__Msg__Sub}{\+\_\+\+Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg\+\_\+\+Sub}} \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga6f77f4fb207e88cc9455ef661d3b9f12}{Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg\+\_\+\+Sub}}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gadcb3ccf8211f36644008f4a8c7ecce77}{eina\+\_\+thread\+\_\+queue\+\_\+new}} (void)
\begin{DoxyCompactList}\small\item\em Creates a new thread queue. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga3797df8c0a9f2dcd86da8c971316e1d3}{eina\+\_\+thread\+\_\+queue\+\_\+free}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq)
\begin{DoxyCompactList}\small\item\em Frees a thread queue. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga44e757fc9b6566f5d209f09a800aa638}{eina\+\_\+thread\+\_\+queue\+\_\+send}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, int size, void $\ast$$\ast$allocref)
\begin{DoxyCompactList}\small\item\em Allocates a message to send down a thread queue. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga338ae6b9a613eb3e227cbab06c94ab4f}{eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, void $\ast$allocref)
\begin{DoxyCompactList}\small\item\em Finishes sending the allocated message. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}{eina\+\_\+thread\+\_\+queue\+\_\+wait}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, void $\ast$$\ast$allocref)
\begin{DoxyCompactList}\small\item\em Fetches a message from a thread queue. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga1ccc3cfbf71e80596f9825d6c6fd6135}{eina\+\_\+thread\+\_\+queue\+\_\+wait\+\_\+done}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, void $\ast$allocref)
\begin{DoxyCompactList}\small\item\em Finishes fetching a message from a thread queue. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga4b9f65958da9fee0e59106d8faf31390}{eina\+\_\+thread\+\_\+queue\+\_\+poll}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, void $\ast$$\ast$allocref)
\begin{DoxyCompactList}\small\item\em Fetches a message from a thread queue, but return immediately if there is none with N\+U\+LL. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga710c894586159601163826961f0f62b4}{eina\+\_\+thread\+\_\+queue\+\_\+pending\+\_\+get}} (const \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq)
\begin{DoxyCompactList}\small\item\em Gets the number of messages on a queue as yet unfetched. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad0903fc27ff93c55b0b432dbbf53491d}{eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+set}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq\+\_\+parent)
\begin{DoxyCompactList}\small\item\em Sets the parent of a thread queue (make this one a child). \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gadb13e550bc7899e83a98b225986d4406}{eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+get}} (const \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq)
\begin{DoxyCompactList}\small\item\em Gets the parent of a thread queue. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gae776bfd1d50f9a591ef6230316c4d72e}{eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+set}} (\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq, int fd)
\begin{DoxyCompactList}\small\item\em Sets a file descriptor to write a byte to on a message send. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gac2389428764e684288e2896c494b5546}{eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+get}} (const \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$thq)
\begin{DoxyCompactList}\small\item\em Gets the file descriptor written to on message sends. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
These functions provide simple zero-\/copy message queues for threads. 

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}\label{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}} 
\index{Thread Queue Group@{Thread Queue Group}!Eina\_Thread\_Queue@{Eina\_Thread\_Queue}}
\index{Eina\_Thread\_Queue@{Eina\_Thread\_Queue}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{Eina\_Thread\_Queue}{Eina\_Thread\_Queue}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}}}

This is a uni-\/directional zero-\/copy thread message queue specifically designed with the idea of sending large volumes of messages with no copies from one thread to another (or from/to the mainloop). The idea is that a thread queue is created and then one or more threads send messages in one end and fetch messages off the other end. If you set a parent message queue to 1 or more queues, then this parent will wake up with a sub queue message, indicating which child queue woke up. This can be used to implement the ability to listen to multiple queues at once.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga691263b2be42e2b5671448f275687eb5}\label{group__Eina__Thread__Queue__Group_ga691263b2be42e2b5671448f275687eb5}} 
\index{Thread Queue Group@{Thread Queue Group}!Eina\_Thread\_Queue\_Msg@{Eina\_Thread\_Queue\_Msg}}
\index{Eina\_Thread\_Queue\_Msg@{Eina\_Thread\_Queue\_Msg}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{Eina\_Thread\_Queue\_Msg}{Eina\_Thread\_Queue\_Msg}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga691263b2be42e2b5671448f275687eb5}{Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg}}}

This is the minimal header of every message to be put into an Eina Thread Queue. Every message has at least this header at the start of the message data, with payload following. You would put this structure as the first struct member of every message type you have, like Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg\+\_\+\+Sub does. Messages are always 8 byte aligned within message memory to ensure alignment of all types.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga6f77f4fb207e88cc9455ef661d3b9f12}\label{group__Eina__Thread__Queue__Group_ga6f77f4fb207e88cc9455ef661d3b9f12}} 
\index{Thread Queue Group@{Thread Queue Group}!Eina\_Thread\_Queue\_Msg\_Sub@{Eina\_Thread\_Queue\_Msg\_Sub}}
\index{Eina\_Thread\_Queue\_Msg\_Sub@{Eina\_Thread\_Queue\_Msg\_Sub}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{Eina\_Thread\_Queue\_Msg\_Sub}{Eina\_Thread\_Queue\_Msg\_Sub}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga6f77f4fb207e88cc9455ef661d3b9f12}{Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg\+\_\+\+Sub}}}

This is a special message type for Eina Thread Queues that have child queues. This is the only Message type for a parent message queue and it indicates which child queue was woken up with a new message to read. When this message is retrieved, the caller should then also fetch the message from the indicated child queue too.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gadcb3ccf8211f36644008f4a8c7ecce77}\label{group__Eina__Thread__Queue__Group_gadcb3ccf8211f36644008f4a8c7ecce77}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_new@{eina\_thread\_queue\_new}}
\index{eina\_thread\_queue\_new@{eina\_thread\_queue\_new}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_new()}{eina\_thread\_queue\_new()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}}$\ast$ eina\+\_\+thread\+\_\+queue\+\_\+new (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Creates a new thread queue. 

\begin{DoxyReturn}{Returns}
A valid new thread queue, or N\+U\+LL on failure
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


References eina\+\_\+semaphore\+\_\+new(), eina\+\_\+spinlock\+\_\+new(), and E\+RR.

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga3797df8c0a9f2dcd86da8c971316e1d3}\label{group__Eina__Thread__Queue__Group_ga3797df8c0a9f2dcd86da8c971316e1d3}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_free@{eina\_thread\_queue\_free}}
\index{eina\_thread\_queue\_free@{eina\_thread\_queue\_free}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_free()}{eina\_thread\_queue\_free()}}
{\footnotesize\ttfamily void eina\+\_\+thread\+\_\+queue\+\_\+free (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq }\end{DoxyParamCaption})}



Frees a thread queue. 

This frees a thread queue. It must no longer be in use by anything waiting on messages or sending them. Any pending messages will be freed without being processed by a listener.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em thq} & The thread queue to free\\
\hline
\end{DoxyParams}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


References eina\+\_\+semaphore\+\_\+free(), and eina\+\_\+spinlock\+\_\+free().

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga44e757fc9b6566f5d209f09a800aa638}\label{group__Eina__Thread__Queue__Group_ga44e757fc9b6566f5d209f09a800aa638}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_send@{eina\_thread\_queue\_send}}
\index{eina\_thread\_queue\_send@{eina\_thread\_queue\_send}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_send()}{eina\_thread\_queue\_send()}}
{\footnotesize\ttfamily void$\ast$ eina\+\_\+thread\+\_\+queue\+\_\+send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{int}]{size,  }\item[{void $\ast$$\ast$}]{allocref }\end{DoxyParamCaption})}



Allocates a message to send down a thread queue. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue to allocate the message on \\
\hline
\mbox{\texttt{ in}}  & {\em size} & The size, in bytes, of the message, including standard header \\
\hline
\mbox{\texttt{ out}}  & {\em allocref} & A pointer to store a general reference handle for the message \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the message data to fill in
\end{DoxyReturn}
This allocates space for a new message on the message queue, but does not actually trigger the send. For that you will need to call \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga338ae6b9a613eb3e227cbab06c94ab4f}{eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done()}} to complete the send and trigger the other side. Every message must at least be a Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg in size and have this structure as the first member (first N bytes) of the message.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


References eina\+\_\+spinlock\+\_\+release(), and eina\+\_\+spinlock\+\_\+take().



Referenced by eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done().

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga338ae6b9a613eb3e227cbab06c94ab4f}\label{group__Eina__Thread__Queue__Group_ga338ae6b9a613eb3e227cbab06c94ab4f}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_send\_done@{eina\_thread\_queue\_send\_done}}
\index{eina\_thread\_queue\_send\_done@{eina\_thread\_queue\_send\_done}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_send\_done()}{eina\_thread\_queue\_send\_done()}}
{\footnotesize\ttfamily void eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{void $\ast$}]{allocref }\end{DoxyParamCaption})}



Finishes sending the allocated message. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue the message was placed on \\
\hline
\mbox{\texttt{ in,out}}  & {\em allocref} & The allocref returned by \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga44e757fc9b6566f5d209f09a800aa638}{eina\+\_\+thread\+\_\+queue\+\_\+send()}}\\
\hline
\end{DoxyParams}
This completes the send and triggers the thread queue to wake up any listeners.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


References eina\+\_\+thread\+\_\+queue\+\_\+send(), eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done(), and E\+RR.



Referenced by eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done().

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}\label{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_wait@{eina\_thread\_queue\_wait}}
\index{eina\_thread\_queue\_wait@{eina\_thread\_queue\_wait}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_wait()}{eina\_thread\_queue\_wait()}}
{\footnotesize\ttfamily void$\ast$ eina\+\_\+thread\+\_\+queue\+\_\+wait (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{void $\ast$$\ast$}]{allocref }\end{DoxyParamCaption})}



Fetches a message from a thread queue. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue to fetch the message from \\
\hline
\mbox{\texttt{ out}}  & {\em allocref} & A pointer to store a general reference handle for the message \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the message data
\end{DoxyReturn}
This will fetch the next message to read from the thread queue and return a pointer to it. The message is guaranteed to have an initial Eina\+\_\+\+Thread\+\_\+\+Queue\+\_\+\+Msg member that will indicate size of the message as a whole. This function will wait, if no messages are available to read and block until a new message comes in, then return. When the message is finished with, the caller must use \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga1ccc3cfbf71e80596f9825d6c6fd6135}{eina\+\_\+thread\+\_\+queue\+\_\+wait\+\_\+done()}} to indicate they are done.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


References eina\+\_\+spinlock\+\_\+release(), and eina\+\_\+spinlock\+\_\+take().

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga1ccc3cfbf71e80596f9825d6c6fd6135}\label{group__Eina__Thread__Queue__Group_ga1ccc3cfbf71e80596f9825d6c6fd6135}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_wait\_done@{eina\_thread\_queue\_wait\_done}}
\index{eina\_thread\_queue\_wait\_done@{eina\_thread\_queue\_wait\_done}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_wait\_done()}{eina\_thread\_queue\_wait\_done()}}
{\footnotesize\ttfamily void eina\+\_\+thread\+\_\+queue\+\_\+wait\+\_\+done (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{void $\ast$}]{allocref }\end{DoxyParamCaption})}



Finishes fetching a message from a thread queue. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue the message was fetched from \\
\hline
\mbox{\texttt{ in,out}}  & {\em allocref} & The allocref returned by \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}}\\
\hline
\end{DoxyParams}
This should be used after \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}} or \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga4b9f65958da9fee0e59106d8faf31390}{eina\+\_\+thread\+\_\+queue\+\_\+poll()}} to indicate the caller is done with the message.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga4b9f65958da9fee0e59106d8faf31390}\label{group__Eina__Thread__Queue__Group_ga4b9f65958da9fee0e59106d8faf31390}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_poll@{eina\_thread\_queue\_poll}}
\index{eina\_thread\_queue\_poll@{eina\_thread\_queue\_poll}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_poll()}{eina\_thread\_queue\_poll()}}
{\footnotesize\ttfamily void$\ast$ eina\+\_\+thread\+\_\+queue\+\_\+poll (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{void $\ast$$\ast$}]{allocref }\end{DoxyParamCaption})}



Fetches a message from a thread queue, but return immediately if there is none with N\+U\+LL. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue to fetch the message from \\
\hline
\mbox{\texttt{ out}}  & {\em allocref} & A pointer to store a general reference handle for the message \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the message data
\end{DoxyReturn}
This is the same as \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}}, but if no messages are available for reading, it immediately returns N\+U\+LL to the caller, without waiting for a new message to arrive.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}


References eina\+\_\+spinlock\+\_\+release(), and eina\+\_\+spinlock\+\_\+take().

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga710c894586159601163826961f0f62b4}\label{group__Eina__Thread__Queue__Group_ga710c894586159601163826961f0f62b4}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_pending\_get@{eina\_thread\_queue\_pending\_get}}
\index{eina\_thread\_queue\_pending\_get@{eina\_thread\_queue\_pending\_get}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_pending\_get()}{eina\_thread\_queue\_pending\_get()}}
{\footnotesize\ttfamily int eina\+\_\+thread\+\_\+queue\+\_\+pending\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq }\end{DoxyParamCaption})}



Gets the number of messages on a queue as yet unfetched. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em thq} & The thread queue to query for pending count \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of messages waiting to be fetched
\end{DoxyReturn}
This returns the number of messages waiting to be fetched with \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad25bf389aa93c3f7f814ff2015eb27ce}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}} or \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga4b9f65958da9fee0e59106d8faf31390}{eina\+\_\+thread\+\_\+queue\+\_\+poll()}}.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gad0903fc27ff93c55b0b432dbbf53491d}\label{group__Eina__Thread__Queue__Group_gad0903fc27ff93c55b0b432dbbf53491d}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_parent\_set@{eina\_thread\_queue\_parent\_set}}
\index{eina\_thread\_queue\_parent\_set@{eina\_thread\_queue\_parent\_set}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_parent\_set()}{eina\_thread\_queue\_parent\_set()}}
{\footnotesize\ttfamily void eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq\+\_\+parent }\end{DoxyParamCaption})}



Sets the parent of a thread queue (make this one a child). 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue to alter the parent of \\
\hline
\mbox{\texttt{ in}}  & {\em thq\+\_\+parent} & The new parent to set\\
\hline
\end{DoxyParams}
This sets the parent queue where messages will be reported to. This is how you can listen to multiple queues at once -\/ set multiple queues to have the same parent and then just wait on that one parent. This should be done before any messages are read from or written to the queue. To unset a parent, just set the parent to N\+U\+LL.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gadb13e550bc7899e83a98b225986d4406}\label{group__Eina__Thread__Queue__Group_gadb13e550bc7899e83a98b225986d4406}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_parent\_get@{eina\_thread\_queue\_parent\_get}}
\index{eina\_thread\_queue\_parent\_get@{eina\_thread\_queue\_parent\_get}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_parent\_get()}{eina\_thread\_queue\_parent\_get()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}}$\ast$ eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq }\end{DoxyParamCaption})}



Gets the parent of a thread queue. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em thq} & The thread queue to get the parent of \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The parent thread queue
\end{DoxyReturn}
This gets the parent set by \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gadb13e550bc7899e83a98b225986d4406}{eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+get()}}. If no parent is set, N\+U\+LL is returned.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_gad0903fc27ff93c55b0b432dbbf53491d}{eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+set()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gae776bfd1d50f9a591ef6230316c4d72e}\label{group__Eina__Thread__Queue__Group_gae776bfd1d50f9a591ef6230316c4d72e}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_fd\_set@{eina\_thread\_queue\_fd\_set}}
\index{eina\_thread\_queue\_fd\_set@{eina\_thread\_queue\_fd\_set}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_fd\_set()}{eina\_thread\_queue\_fd\_set()}}
{\footnotesize\ttfamily void eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq,  }\item[{int}]{fd }\end{DoxyParamCaption})}



Sets a file descriptor to write a byte to on a message send. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em thq} & The thread queue to set the file descriptor of \\
\hline
\mbox{\texttt{ in}}  & {\em fd} & The fd to set, or -\/1 to unset it\\
\hline
\end{DoxyParams}
This sets a file descriptor to write to when a message is written to the thread queue. This can be used to glue a thread queue to something like an Ecore\+\_\+\+Pipe that can wake up the mainloop and call a callback whenever data is available on the pipe. The number of bytes available will be the number of messages to fetch from the associated thread queue.

You should set this up before anything writes to or reads from this thread queue.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gac2389428764e684288e2896c494b5546}\label{group__Eina__Thread__Queue__Group_gac2389428764e684288e2896c494b5546}} 
\index{Thread Queue Group@{Thread Queue Group}!eina\_thread\_queue\_fd\_get@{eina\_thread\_queue\_fd\_get}}
\index{eina\_thread\_queue\_fd\_get@{eina\_thread\_queue\_fd\_get}!Thread Queue Group@{Thread Queue Group}}
\doxysubsubsection{\texorpdfstring{eina\_thread\_queue\_fd\_get()}{eina\_thread\_queue\_fd\_get()}}
{\footnotesize\ttfamily int eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$}]{thq }\end{DoxyParamCaption})}



Gets the file descriptor written to on message sends. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em thq} & The thread queue to get the file descriptor of \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The file descriptor set (or -\/1 if none is set).
\end{DoxyReturn}
This returns the file descriptor set by \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gae776bfd1d50f9a591ef6230316c4d72e}{eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+set()}} and by default returns -\/1 (no fd set).

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_gae776bfd1d50f9a591ef6230316c4d72e}{eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+set()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
