\rhead{\bf MC\_WaitRetrieveAgent()}
\noindent
\vspace{5pt}
\rule{6.5in}{0.015in}
\noindent
{\LARGE \bf MC\_WaitRetrieveAgent()\index{MC\_WaitRetrieveAgent()}}\\
\phantomsection
\addcontentsline{toc}{section}{MC\_WaitRetrieveAgent()}

\noindent
{\bf Synopsis}\\
{\bf \#include $<$libmc.h$>$}\\
{\bf MCAgent\_t MC\_WaitRetrieveAgent}({\bf MCAgency\_t} $agency$);\\

\noindent
{\bf Purpose}\\
Block the calling thread until a mobile agent arrives, and return the mobile 
agent instead of executing it.\\

\noindent
{\bf Return Value}\\
The function returns a mobile agent on success and a NULL on failure.\\

\noindent
{\bf Parameters}
\vspace{-0.1in}
\begin{description}
\item               
\begin{tabular}{p{10 mm}p{145 mm}}
$agency$ & A handle associated with a running agency. 
\end{tabular}
\end{description}

\noindent
{\bf Description}\\
This function waits on an agency and wakes up the addition of a new mobile 
agent to the agency. 
It will then remove the mobile agent from the agency and return it.\\

\noindent
{\bf Example}\\
\noindent
{\footnotesize\verbatiminput{../demos/mobilec_c-space_functionality/cspace_misc_examples/server.c}}

\noindent
{\bf See Also}\\

%\CPlot::\DataThreeD(), \CPlot::\DataFile(), \CPlot::\Plotting(), \plotxy().\\
