\hypertarget{structevthread__condition__callbacks}{\section{evthread\+\_\+condition\+\_\+callbacks Struct Reference}
\label{structevthread__condition__callbacks}\index{evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}}
}


This structure describes the interface a threading library uses for condition variables.  




{\ttfamily \#include $<$thread.\+h$>$}

\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{structevthread__condition__callbacks_a632a051711c8f7728e3464721d7c8084}{condition\+\_\+api\+\_\+version}
\begin{DoxyCompactList}\small\item\em The current version of the conditions A\+P\+I. \end{DoxyCompactList}\item 
void $\ast$($\ast$ \hyperlink{structevthread__condition__callbacks_a99a6a879561ac8cd0f660048cec9457d}{alloc\+\_\+condition} )(unsigned condtype)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to allocate and initialize a new condition variable. \end{DoxyCompactList}\item 
void($\ast$ \hyperlink{structevthread__condition__callbacks_a6a1a0b0f66445a818c9a39e0ae30ddff}{free\+\_\+condition} )(void $\ast$cond)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to free a condition variable. \end{DoxyCompactList}\item 
int($\ast$ \hyperlink{structevthread__condition__callbacks_a4640f20f63614f0ad96b5f135b076a9d}{signal\+\_\+condition} )(void $\ast$cond, int broadcast)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to signal a condition variable. \end{DoxyCompactList}\item 
int($\ast$ \hyperlink{structevthread__condition__callbacks_ad1a48e1cc7f15ac7ac603f3dacd85d76}{wait\+\_\+condition} )(void $\ast$cond, void $\ast$lock, const struct timeval $\ast$timeout)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to wait for a condition variable. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This structure describes the interface a threading library uses for condition variables. 

It's used to tell evthread\+\_\+set\+\_\+condition\+\_\+callbacks how to use locking on this platform. 

\subsection{Field Documentation}
\hypertarget{structevthread__condition__callbacks_a99a6a879561ac8cd0f660048cec9457d}{\index{evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}!alloc\+\_\+condition@{alloc\+\_\+condition}}
\index{alloc\+\_\+condition@{alloc\+\_\+condition}!evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}}
\subsubsection[{alloc\+\_\+condition}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$($\ast$ evthread\+\_\+condition\+\_\+callbacks\+::alloc\+\_\+condition)(unsigned condtype)}}\label{structevthread__condition__callbacks_a99a6a879561ac8cd0f660048cec9457d}


\hyperlink{structFunction}{Function} to allocate and initialize a new condition variable. 

Returns the condition variable on success, and N\+U\+L\+L on failure. The 'condtype' argument will be 0 with this A\+P\+I version. 

Referenced by evthread\+\_\+set\+\_\+condition\+\_\+callbacks().

\hypertarget{structevthread__condition__callbacks_a632a051711c8f7728e3464721d7c8084}{\index{evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}!condition\+\_\+api\+\_\+version@{condition\+\_\+api\+\_\+version}}
\index{condition\+\_\+api\+\_\+version@{condition\+\_\+api\+\_\+version}!evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}}
\subsubsection[{condition\+\_\+api\+\_\+version}]{\setlength{\rightskip}{0pt plus 5cm}int evthread\+\_\+condition\+\_\+callbacks\+::condition\+\_\+api\+\_\+version}}\label{structevthread__condition__callbacks_a632a051711c8f7728e3464721d7c8084}


The current version of the conditions A\+P\+I. 

Set this to E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+C\+O\+N\+D\+I\+T\+I\+O\+N\+\_\+\+A\+P\+I\+\_\+\+V\+E\+R\+S\+I\+O\+N \hypertarget{structevthread__condition__callbacks_a6a1a0b0f66445a818c9a39e0ae30ddff}{\index{evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}!free\+\_\+condition@{free\+\_\+condition}}
\index{free\+\_\+condition@{free\+\_\+condition}!evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}}
\subsubsection[{free\+\_\+condition}]{\setlength{\rightskip}{0pt plus 5cm}void($\ast$ evthread\+\_\+condition\+\_\+callbacks\+::free\+\_\+condition)(void $\ast$cond)}}\label{structevthread__condition__callbacks_a6a1a0b0f66445a818c9a39e0ae30ddff}


\hyperlink{structFunction}{Function} to free a condition variable. 



Referenced by evthread\+\_\+set\+\_\+condition\+\_\+callbacks().

\hypertarget{structevthread__condition__callbacks_a4640f20f63614f0ad96b5f135b076a9d}{\index{evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}!signal\+\_\+condition@{signal\+\_\+condition}}
\index{signal\+\_\+condition@{signal\+\_\+condition}!evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}}
\subsubsection[{signal\+\_\+condition}]{\setlength{\rightskip}{0pt plus 5cm}int($\ast$ evthread\+\_\+condition\+\_\+callbacks\+::signal\+\_\+condition)(void $\ast$cond, int broadcast)}}\label{structevthread__condition__callbacks_a4640f20f63614f0ad96b5f135b076a9d}


\hyperlink{structFunction}{Function} to signal a condition variable. 

If 'broadcast' is 1, all threads waiting on 'cond' should be woken; otherwise, only on one thread is worken. Should return 0 on success, -\/1 on failure. This function will only be called while holding the associated lock for the condition. 

Referenced by evthread\+\_\+set\+\_\+condition\+\_\+callbacks().

\hypertarget{structevthread__condition__callbacks_ad1a48e1cc7f15ac7ac603f3dacd85d76}{\index{evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}!wait\+\_\+condition@{wait\+\_\+condition}}
\index{wait\+\_\+condition@{wait\+\_\+condition}!evthread\+\_\+condition\+\_\+callbacks@{evthread\+\_\+condition\+\_\+callbacks}}
\subsubsection[{wait\+\_\+condition}]{\setlength{\rightskip}{0pt plus 5cm}int($\ast$ evthread\+\_\+condition\+\_\+callbacks\+::wait\+\_\+condition)(void $\ast$cond, void $\ast$lock, const struct timeval $\ast$timeout)}}\label{structevthread__condition__callbacks_ad1a48e1cc7f15ac7ac603f3dacd85d76}


\hyperlink{structFunction}{Function} to wait for a condition variable. 

The lock 'lock' will be held when this function is called; should be released while waiting for the condition to be come signalled, and should be held again when this function returns. If timeout is provided, it is interval of seconds to wait for the event to become signalled; if it is N\+U\+L\+L, the function should wait indefinitely.

The function should return -\/1 on error; 0 if the condition was signalled, or 1 on a timeout. 

Referenced by evthread\+\_\+enable\+\_\+lock\+\_\+debuging(), and evthread\+\_\+set\+\_\+condition\+\_\+callbacks().



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
opal/mca/event/libevent2013/libevent/include/event2/\hyperlink{thread_8h}{thread.\+h}\end{DoxyCompactItemize}
