\hypertarget{SEM_8ih}{
\section{SEM.ih File Reference}
\label{SEM_8ih}\index{SEM.ih@{SEM.ih}}
}
Simple semaphore, inline interface and implementation.  


{\tt \#include $<$PBI/Inline.h$>$}\par
{\tt \#include $<$PBI/Attribute.h$>$}\par
{\tt \#include $<$PBS/SEM.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{SEM_8ih_b76200a5a244c55e2bc8dffa55b1df23}{
\#define \hyperlink{SEM_8ih_b76200a5a244c55e2bc8dffa55b1df23}{SEM\_\-\_\-EXP\_\-PROTO}~INLINE\_\-USR\_\-EXP\_\-PROTO}
\label{SEM_8ih_b76200a5a244c55e2bc8dffa55b1df23}

\begin{CompactList}\small\item\em Export Prototype spec. \item\end{CompactList}\item 
\hypertarget{SEM_8ih_9a70d52767add560ab81de7eba9503ae}{
\#define \hyperlink{SEM_8ih_9a70d52767add560ab81de7eba9503ae}{SEM\_\-\_\-LCL\_\-PROTO}~INLINE\_\-USR\_\-LCL\_\-PROTO}
\label{SEM_8ih_9a70d52767add560ab81de7eba9503ae}

\begin{CompactList}\small\item\em Internal Prototype spec. \item\end{CompactList}\item 
\hypertarget{SEM_8ih_6f991b1506d77f8b55fd46f4c134b9a0}{
\#define \hyperlink{SEM_8ih_6f991b1506d77f8b55fd46f4c134b9a0}{SEM\_\-\_\-EXP\_\-FNC}~INLINE\_\-USR\_\-EXP\_\-FNC}
\label{SEM_8ih_6f991b1506d77f8b55fd46f4c134b9a0}

\begin{CompactList}\small\item\em Export Function declaration. \item\end{CompactList}\item 
\hypertarget{SEM_8ih_6044e6ff345fe2971a215ea9fe7a7fca}{
\#define \hyperlink{SEM_8ih_6044e6ff345fe2971a215ea9fe7a7fca}{SEM\_\-\_\-LCL\_\-FNC}~INLINE\_\-USR\_\-LCL\_\-FNC}
\label{SEM_8ih_6044e6ff345fe2971a215ea9fe7a7fca}

\begin{CompactList}\small\item\em Internal Function declaration. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
SEM\_\-\_\-EXP\_\-PROTO \hyperlink{SEM_8h_8px-xxx-xxx_57c0945c6e1df9e526063d39e7d342c4}{SEM} \hyperlink{SEM_8ih_63e14fb645eb6f92e25ad4a3a643f541}{SEM\_\-\_\-create} (unsigned int options) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Creates a semaphore. \item\end{CompactList}\item 
SEM\_\-\_\-EXP\_\-PROTO unsigned int \hyperlink{SEM_8ih_5fe84b0f3aef4fcfb9befd7db1ccc4d6}{SEM\_\-\_\-takeW} (\hyperlink{SEM_8h_8px-xxx-xxx_57c0945c6e1df9e526063d39e7d342c4}{SEM} semaphore) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Takes the semaphore. This call will block until the semaphore can be acquired. \item\end{CompactList}\item 
SEM\_\-\_\-EXP\_\-PROTO unsigned int \hyperlink{SEM_8ih_af9a63b74e309996d1bd943d9350ab24}{SEM\_\-\_\-give} (\hyperlink{SEM_8h_8px-xxx-xxx_57c0945c6e1df9e526063d39e7d342c4}{SEM} give) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Gives the semaphore. \item\end{CompactList}\item 
SEM\_\-\_\-EXP\_\-PROTO unsigned int \hyperlink{SEM_8ih_27e225c0f5bdc48bf1f0f1cfd6b968a4}{SEM\_\-\_\-destroy} (\hyperlink{SEM_8h_8px-xxx-xxx_57c0945c6e1df9e526063d39e7d342c4}{SEM} semaphore) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Destroys the semaphore. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Simple semaphore, inline interface and implementation. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

    CVS $Id: SEM.ih,v 1.4 2011/03/24 23:05:44 apw Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{SEM_8ih_63e14fb645eb6f92e25ad4a3a643f541}{
\index{SEM.ih@{SEM.ih}!SEM\_\-\_\-create@{SEM\_\-\_\-create}}
\index{SEM\_\-\_\-create@{SEM\_\-\_\-create}!SEM.ih@{SEM.ih}}
\subsubsection[{SEM\_\-\_\-create}]{\setlength{\rightskip}{0pt plus 5cm}SEM\_\-\_\-EXP\_\-PROTO {\bf SEM} SEM\_\-\_\-create (unsigned int {\em options})}}
\label{SEM_8ih_63e14fb645eb6f92e25ad4a3a643f541}


Creates a semaphore. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em options}]A bit mask of options formed from the enumeration SEM\_\-OPTIONS\_\-M \end{description}
\end{Desc}


References MBA\_\-alloc(), and MBA\_\-free().\hypertarget{SEM_8ih_27e225c0f5bdc48bf1f0f1cfd6b968a4}{
\index{SEM.ih@{SEM.ih}!SEM\_\-\_\-destroy@{SEM\_\-\_\-destroy}}
\index{SEM\_\-\_\-destroy@{SEM\_\-\_\-destroy}!SEM.ih@{SEM.ih}}
\subsubsection[{SEM\_\-\_\-destroy}]{\setlength{\rightskip}{0pt plus 5cm}SEM\_\-\_\-EXP\_\-PROTO unsigned int SEM\_\-\_\-destroy ({\bf SEM} {\em semaphore})}}
\label{SEM_8ih_27e225c0f5bdc48bf1f0f1cfd6b968a4}


Destroys the semaphore. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em semaphore}]The semaphore to destroy \end{description}
\end{Desc}


References MBA\_\-free().\hypertarget{SEM_8ih_af9a63b74e309996d1bd943d9350ab24}{
\index{SEM.ih@{SEM.ih}!SEM\_\-\_\-give@{SEM\_\-\_\-give}}
\index{SEM\_\-\_\-give@{SEM\_\-\_\-give}!SEM.ih@{SEM.ih}}
\subsubsection[{SEM\_\-\_\-give}]{\setlength{\rightskip}{0pt plus 5cm}SEM\_\-\_\-EXP\_\-PROTO unsigned int SEM\_\-\_\-give ({\bf SEM} {\em semaphore})}}
\label{SEM_8ih_af9a63b74e309996d1bd943d9350ab24}


Gives the semaphore. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em semaphore}]The semaphore to give \end{description}
\end{Desc}
\hypertarget{SEM_8ih_5fe84b0f3aef4fcfb9befd7db1ccc4d6}{
\index{SEM.ih@{SEM.ih}!SEM\_\-\_\-takeW@{SEM\_\-\_\-takeW}}
\index{SEM\_\-\_\-takeW@{SEM\_\-\_\-takeW}!SEM.ih@{SEM.ih}}
\subsubsection[{SEM\_\-\_\-takeW}]{\setlength{\rightskip}{0pt plus 5cm}SEM\_\-\_\-EXP\_\-PROTO unsigned int SEM\_\-\_\-takeW ({\bf SEM} {\em semaphore})}}
\label{SEM_8ih_5fe84b0f3aef4fcfb9befd7db1ccc4d6}


Takes the semaphore. This call will block until the semaphore can be acquired. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em semaphore}]The semamphore to take \end{description}
\end{Desc}
