\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}}
\begin{DoxyCompactList}\small\item\em 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). \end{DoxyCompactList}\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}}
\begin{DoxyCompactList}\small\item\em This is the minimal header of every message to be put into an Eina Thread Queue. \end{DoxyCompactList}\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}}
\begin{DoxyCompactList}\small\item\em This is a special message type for Eina Thread Queues that have child queues. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga4c11010115bea40a3171057ba02fac02}{eina\+\_\+thread\+\_\+queue\+\_\+new}} (void)
\begin{DoxyCompactList}\small\item\em Creates a new thread queue. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga2dc50362ecdf88dc8f49d389d75cddfc}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga9879e24c83b2f217b4637adca4ec2b08}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga608f2e364a412702b66dfab1e0a9cb49}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gac2caf83a04880c08c3eb50cd531b6d08}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga1ee572830d2decde1ab4563af506f048}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gafc32887c0c7e4e9a8e00c1eb23b4c467}{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 NULL. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} int \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga31bb3d31c852d7eb27c33995cc9d085e}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gadd71fbfc538c180554bec7ac26cdec4c}{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__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga414a1a16533bf9ba8bdf14ffb61c2ed9}{Eina\+\_\+\+Thread\+\_\+\+Queue}} $\ast$ \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gaf83842f148654921feeb8b25ba3bbf22}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga388e7fbe95fd962037619d8b5aebaaee}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} int \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga040d162dc13985cef40d27cd77386975}{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_ga4c11010115bea40a3171057ba02fac02}\label{group__Eina__Thread__Queue__Group_ga4c11010115bea40a3171057ba02fac02}} 
\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__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \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 NULL on failure
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga2dc50362ecdf88dc8f49d389d75cddfc}\label{group__Eina__Thread__Queue__Group_ga2dc50362ecdf88dc8f49d389d75cddfc}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga9879e24c83b2f217b4637adca4ec2b08}\label{group__Eina__Thread__Queue__Group_ga9879e24c83b2f217b4637adca4ec2b08}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_ga608f2e364a412702b66dfab1e0a9cb49}{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}


Referenced by \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga608f2e364a412702b66dfab1e0a9cb49}{eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done()}}.

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga608f2e364a412702b66dfab1e0a9cb49}\label{group__Eina__Thread__Queue__Group_ga608f2e364a412702b66dfab1e0a9cb49}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_ga9879e24c83b2f217b4637adca4ec2b08}{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 \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga9879e24c83b2f217b4637adca4ec2b08}{eina\+\_\+thread\+\_\+queue\+\_\+send()}}, and \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga608f2e364a412702b66dfab1e0a9cb49}{eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done()}}.



Referenced by \mbox{\hyperlink{group__Eina__Thread__Queue__Group_ga608f2e364a412702b66dfab1e0a9cb49}{eina\+\_\+thread\+\_\+queue\+\_\+send\+\_\+done()}}.

\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gac2caf83a04880c08c3eb50cd531b6d08}\label{group__Eina__Thread__Queue__Group_gac2caf83a04880c08c3eb50cd531b6d08}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_ga1ee572830d2decde1ab4563af506f048}{eina\+\_\+thread\+\_\+queue\+\_\+wait\+\_\+done()}} to indicate they are done.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga1ee572830d2decde1ab4563af506f048}\label{group__Eina__Thread__Queue__Group_ga1ee572830d2decde1ab4563af506f048}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_gac2caf83a04880c08c3eb50cd531b6d08}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}}\\
\hline
\end{DoxyParams}
This should be used after \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gac2caf83a04880c08c3eb50cd531b6d08}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}} or \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gafc32887c0c7e4e9a8e00c1eb23b4c467}{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_gafc32887c0c7e4e9a8e00c1eb23b4c467}\label{group__Eina__Thread__Queue__Group_gafc32887c0c7e4e9a8e00c1eb23b4c467}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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 NULL. 


\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_gac2caf83a04880c08c3eb50cd531b6d08}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}}, but if no messages are available for reading, it immediately returns NULL to the caller, without waiting for a new message to arrive.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_gac2caf83a04880c08c3eb50cd531b6d08}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga31bb3d31c852d7eb27c33995cc9d085e}\label{group__Eina__Thread__Queue__Group_ga31bb3d31c852d7eb27c33995cc9d085e}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_gac2caf83a04880c08c3eb50cd531b6d08}{eina\+\_\+thread\+\_\+queue\+\_\+wait()}} or \mbox{\hyperlink{group__Eina__Thread__Queue__Group_gafc32887c0c7e4e9a8e00c1eb23b4c467}{eina\+\_\+thread\+\_\+queue\+\_\+poll()}}.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gadd71fbfc538c180554bec7ac26cdec4c}\label{group__Eina__Thread__Queue__Group_gadd71fbfc538c180554bec7ac26cdec4c}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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 NULL.

\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_gaf83842f148654921feeb8b25ba3bbf22}\label{group__Eina__Thread__Queue__Group_gaf83842f148654921feeb8b25ba3bbf22}} 
\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__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \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_gaf83842f148654921feeb8b25ba3bbf22}{eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+get()}}. If no parent is set, NULL is returned.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eina__Thread__Queue__Group_gadd71fbfc538c180554bec7ac26cdec4c}{eina\+\_\+thread\+\_\+queue\+\_\+parent\+\_\+set()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+11 
\end{DoxySince}
\mbox{\Hypertarget{group__Eina__Thread__Queue__Group_ga388e7fbe95fd962037619d8b5aebaaee}\label{group__Eina__Thread__Queue__Group_ga388e7fbe95fd962037619d8b5aebaaee}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_ga040d162dc13985cef40d27cd77386975}\label{group__Eina__Thread__Queue__Group_ga040d162dc13985cef40d27cd77386975}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_ga388e7fbe95fd962037619d8b5aebaaee}{eina\+\_\+thread\+\_\+queue\+\_\+fd\+\_\+set()}} and by default returns -\/1 (no fd set).

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