\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 $<$IPBS/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_8vx-xxx-xxx_57c0945c6e1df9e526063d39e7d342c4}{SEM} \hyperlink{SEM_8ih_9ea2b858503684002131c6794a206b82}{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_424677df33a85db705b3358433db53d9}{SEM\_\-\_\-takeW} (\hyperlink{SEM_8h_8vx-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_f05eef56c462e0ea8ab2bf4f339b30cb}{SEM\_\-\_\-give} (\hyperlink{SEM_8h_8vx-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_da39a49cbee20dd795a147cbde52a25d}{SEM\_\-\_\-destroy} (\hyperlink{SEM_8h_8vx-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.2 2011/03/25 21:15:02 saxton Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{SEM_8ih_9ea2b858503684002131c6794a206b82}{
\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}{\bf SEM} SEM\_\-\_\-create (unsigned int {\em options})}}
\label{SEM_8ih_9ea2b858503684002131c6794a206b82}


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}
\hypertarget{SEM_8ih_da39a49cbee20dd795a147cbde52a25d}{
\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}unsigned int SEM\_\-\_\-destroy ({\bf SEM} {\em semaphore})}}
\label{SEM_8ih_da39a49cbee20dd795a147cbde52a25d}


Destroys the semaphore. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em semaphore}]The semaphore to destroy \end{description}
\end{Desc}
\hypertarget{SEM_8ih_f05eef56c462e0ea8ab2bf4f339b30cb}{
\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}unsigned int SEM\_\-\_\-give ({\bf SEM} {\em semaphore})}}
\label{SEM_8ih_f05eef56c462e0ea8ab2bf4f339b30cb}


Gives the semaphore. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em semaphore}]The semaphore to give \end{description}
\end{Desc}
\hypertarget{SEM_8ih_424677df33a85db705b3358433db53d9}{
\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}unsigned int SEM\_\-\_\-takeW ({\bf SEM} {\em semaphore})}}
\label{SEM_8ih_424677df33a85db705b3358433db53d9}


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}
