\hypertarget{structevthread__lock__callbacks}{\section{evthread\+\_\+lock\+\_\+callbacks Struct Reference}
\label{structevthread__lock__callbacks}\index{evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}}
}


This structure describes the interface a threading library uses for locking.  




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

\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{structevthread__lock__callbacks_afe0e286cfffd238f4891bdb431c79eb9}{lock\+\_\+api\+\_\+version}
\begin{DoxyCompactList}\small\item\em The current version of the locking A\+P\+I. \end{DoxyCompactList}\item 
unsigned \hyperlink{structevthread__lock__callbacks_afebbd92f9fc12e5852b0c008b423f948}{supported\+\_\+locktypes}
\begin{DoxyCompactList}\small\item\em Which kinds of locks does this version of the locking A\+P\+I support? A bitfield of E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+T\+Y\+P\+E\+\_\+\+R\+E\+C\+U\+R\+S\+I\+V\+E and E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+T\+Y\+P\+E\+\_\+\+R\+E\+A\+D\+W\+R\+I\+T\+E. \end{DoxyCompactList}\item 
void $\ast$($\ast$ \hyperlink{structevthread__lock__callbacks_a25e81b496381c4edb018308e03b9bf03}{alloc} )(unsigned locktype)
\begin{DoxyCompactList}\small\item\em \hyperlink{structFunction}{Function} to allocate and initialize new lock of type 'locktype'. \end{DoxyCompactList}\item 
void($\ast$ \hyperlink{structevthread__lock__callbacks_a100c34a1663b7559d3221c8a51ebaac3}{free} )(void $\ast$\hyperlink{structevthread__lock__callbacks_a0ed763a13fc4e45867b2103ca462b77d}{lock}, unsigned locktype)
\begin{DoxyCompactList}\small\item\em Funtion to release all storage held in 'lock', which was created with type 'locktype'. \end{DoxyCompactList}\item 
int($\ast$ \hyperlink{structevthread__lock__callbacks_a0ed763a13fc4e45867b2103ca462b77d}{lock} )(unsigned mode, void $\ast$lock)
\begin{DoxyCompactList}\small\item\em Acquire an already-\/allocated lock at 'lock' with mode 'mode'. \end{DoxyCompactList}\item 
int($\ast$ \hyperlink{structevthread__lock__callbacks_ae532146a30d775906fae556967688576}{unlock} )(unsigned mode, void $\ast$\hyperlink{structevthread__lock__callbacks_a0ed763a13fc4e45867b2103ca462b77d}{lock})
\begin{DoxyCompactList}\small\item\em Release a lock at 'lock' using mode 'mode'. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

It's used to tell \hyperlink{thread_8h_a89fd5de575d5f0fba24d0e8e0a25c641}{evthread\+\_\+set\+\_\+lock\+\_\+callbacks()} how to use locking on this platform. 

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


\hyperlink{structFunction}{Function} to allocate and initialize new lock of type 'locktype'. 

Returns N\+U\+L\+L on failure. 

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

\hypertarget{structevthread__lock__callbacks_a100c34a1663b7559d3221c8a51ebaac3}{\index{evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}!free@{free}}
\index{free@{free}!evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}}
\subsubsection[{free}]{\setlength{\rightskip}{0pt plus 5cm}void($\ast$ evthread\+\_\+lock\+\_\+callbacks\+::free)(void $\ast${\bf lock}, unsigned locktype)}}\label{structevthread__lock__callbacks_a100c34a1663b7559d3221c8a51ebaac3}


Funtion to release all storage held in 'lock', which was created with type 'locktype'. 



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

\hypertarget{structevthread__lock__callbacks_a0ed763a13fc4e45867b2103ca462b77d}{\index{evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}!lock@{lock}}
\index{lock@{lock}!evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}}
\subsubsection[{lock}]{\setlength{\rightskip}{0pt plus 5cm}int($\ast$ evthread\+\_\+lock\+\_\+callbacks\+::lock)(unsigned mode, void $\ast$lock)}}\label{structevthread__lock__callbacks_a0ed763a13fc4e45867b2103ca462b77d}


Acquire an already-\/allocated lock at 'lock' with mode 'mode'. 

Returns 0 on success, and nonzero on failure. 

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

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


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

Set this to E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+\_\+\+A\+P\+I\+\_\+\+V\+E\+R\+S\+I\+O\+N \hypertarget{structevthread__lock__callbacks_afebbd92f9fc12e5852b0c008b423f948}{\index{evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}!supported\+\_\+locktypes@{supported\+\_\+locktypes}}
\index{supported\+\_\+locktypes@{supported\+\_\+locktypes}!evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}}
\subsubsection[{supported\+\_\+locktypes}]{\setlength{\rightskip}{0pt plus 5cm}unsigned evthread\+\_\+lock\+\_\+callbacks\+::supported\+\_\+locktypes}}\label{structevthread__lock__callbacks_afebbd92f9fc12e5852b0c008b423f948}


Which kinds of locks does this version of the locking A\+P\+I support? A bitfield of E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+T\+Y\+P\+E\+\_\+\+R\+E\+C\+U\+R\+S\+I\+V\+E and E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+T\+Y\+P\+E\+\_\+\+R\+E\+A\+D\+W\+R\+I\+T\+E. 

(Note that R\+E\+C\+U\+R\+S\+I\+V\+E locks are currently mandatory, and R\+E\+A\+D\+W\+R\+I\+T\+E locks are not currently used.) \hypertarget{structevthread__lock__callbacks_ae532146a30d775906fae556967688576}{\index{evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}!unlock@{unlock}}
\index{unlock@{unlock}!evthread\+\_\+lock\+\_\+callbacks@{evthread\+\_\+lock\+\_\+callbacks}}
\subsubsection[{unlock}]{\setlength{\rightskip}{0pt plus 5cm}int($\ast$ evthread\+\_\+lock\+\_\+callbacks\+::unlock)(unsigned mode, void $\ast${\bf lock})}}\label{structevthread__lock__callbacks_ae532146a30d775906fae556967688576}


Release a lock at 'lock' using mode 'mode'. 

Returns 0 on success, and nonzero on failure. 

Referenced by evthread\+\_\+set\+\_\+lock\+\_\+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}
