\doxysubsection{SVM process ownership}
\hypertarget{group__ownershipprocesses}{}\label{group__ownershipprocesses}\index{SVM process ownership@{SVM process ownership}}


This module contains API functions to handle SVM process ownership.  


\doxysubsubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_gabdebe955bb051d608ee64f9ddf2a24da}{SVM\+\_\+\+Process\+\_\+\+Lock}} \mbox{\hyperlink{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}{svm\+\_\+process\+\_\+ownership\+\_\+lock}} (const void \texorpdfstring{$\ast$}{*}svm, const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}} process)
\begin{DoxyCompactList}\small\item\em This function locks a process from the current process. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_gabdebe955bb051d608ee64f9ddf2a24da}{SVM\+\_\+\+Process\+\_\+\+Lock}} \mbox{\hyperlink{group__ownershipprocesses_gacf9cf341788aa84c0e84354958feaf50}{svm\+\_\+process\+\_\+ownership\+\_\+lock\+\_\+critical}} (const void \texorpdfstring{$\ast$}{*}svm)
\begin{DoxyCompactList}\small\item\em This function locks all other processes. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_ga872facc2eea0e7296e689134f568b804}{SVM\+\_\+\+Boolean}} \mbox{\hyperlink{group__ownershipprocesses_ga56f370208a3bafd6f00b4b0564ac2a67}{svm\+\_\+process\+\_\+ownership\+\_\+check}} (const void \texorpdfstring{$\ast$}{*}svm, const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}} process)
\begin{DoxyCompactList}\small\item\em This function checks whether the current process owns another process. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_ga872facc2eea0e7296e689134f568b804}{SVM\+\_\+\+Boolean}} \mbox{\hyperlink{group__ownershipprocesses_gaf4f992be8efbc074e1f4578fd0106bd6}{svm\+\_\+process\+\_\+ownership\+\_\+get\+\_\+local}} (const void \texorpdfstring{$\ast$}{*}svm, const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}} process)
\begin{DoxyCompactList}\small\item\em This function locally takes ownership over another process. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
This module contains API functions to handle SVM process ownership. 



\doxysubsubsection{Function Documentation}
\Hypertarget{group__ownershipprocesses_ga56f370208a3bafd6f00b4b0564ac2a67}\label{group__ownershipprocesses_ga56f370208a3bafd6f00b4b0564ac2a67} 
\index{SVM process ownership@{SVM process ownership}!svm\_process\_ownership\_check@{svm\_process\_ownership\_check}}
\index{svm\_process\_ownership\_check@{svm\_process\_ownership\_check}!SVM process ownership@{SVM process ownership}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_ownership\_check()}{svm\_process\_ownership\_check()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_ga872facc2eea0e7296e689134f568b804}{SVM\+\_\+\+Boolean}} svm\+\_\+process\+\_\+ownership\+\_\+check (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}}}]{process }\end{DoxyParamCaption})}



This function checks whether the current process owns another process. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em process} & The process ownership to check.\\
\hline
\end{DoxyParams}
The current process owns another process when\+:
\begin{DoxyItemize}
\item Either the process is also the current process,
\item Or a lock exists on the process from the current process.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
TRUE when the current process owns the process, FALSE otherwise.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.)\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}{svm\+\_\+process\+\_\+ownership\+\_\+lock} 

\doxylink{group__ownershipprocesses_gacf9cf341788aa84c0e84354958feaf50}{svm\+\_\+process\+\_\+ownership\+\_\+lock\+\_\+critical} 

\doxylink{group__variables_ga5dba265f37ba41add5a7ffd7dfdb3243}{svm\+\_\+variable\+\_\+delete} 
\end{DoxySeeAlso}
\Hypertarget{group__ownershipprocesses_gaf4f992be8efbc074e1f4578fd0106bd6}\label{group__ownershipprocesses_gaf4f992be8efbc074e1f4578fd0106bd6} 
\index{SVM process ownership@{SVM process ownership}!svm\_process\_ownership\_get\_local@{svm\_process\_ownership\_get\_local}}
\index{svm\_process\_ownership\_get\_local@{svm\_process\_ownership\_get\_local}!SVM process ownership@{SVM process ownership}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_ownership\_get\_local()}{svm\_process\_ownership\_get\_local()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_ga872facc2eea0e7296e689134f568b804}{SVM\+\_\+\+Boolean}} svm\+\_\+process\+\_\+ownership\+\_\+get\+\_\+local (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}}}]{process }\end{DoxyParamCaption})}



This function locally takes ownership over another process. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em process} & The process ownership to take locally.\\
\hline
\end{DoxyParams}
The current process takes the ownership of the process until the end of the plugin callback.

\begin{DoxyNote}{Note}
If a lock is acquired, it is placed in an hidden local variable.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
TRUE when the current process succeeds to own the process, FALSE otherwise.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when this API function is called outside a waiting instruction.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}{svm\+\_\+process\+\_\+ownership\+\_\+lock} 

\doxylink{group__ownershipprocesses_gacf9cf341788aa84c0e84354958feaf50}{svm\+\_\+process\+\_\+ownership\+\_\+lock\+\_\+critical} 

\doxylink{group__variables_ga5dba265f37ba41add5a7ffd7dfdb3243}{svm\+\_\+variable\+\_\+delete} 
\end{DoxySeeAlso}
\Hypertarget{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}\label{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205} 
\index{SVM process ownership@{SVM process ownership}!svm\_process\_ownership\_lock@{svm\_process\_ownership\_lock}}
\index{svm\_process\_ownership\_lock@{svm\_process\_ownership\_lock}!SVM process ownership@{SVM process ownership}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_ownership\_lock()}{svm\_process\_ownership\_lock()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_gabdebe955bb051d608ee64f9ddf2a24da}{SVM\+\_\+\+Process\+\_\+\+Lock}} svm\+\_\+process\+\_\+ownership\+\_\+lock (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm,  }\item[{const \mbox{\hyperlink{group__api__types_gabbfa54994e431fe68d4f6580c112e1a0}{SVM\+\_\+\+Process}}}]{process }\end{DoxyParamCaption})}



This function locks a process from the current process. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function. \\
\hline
\mbox{\texttt{ in}}  & {\em process} & The process to lock.\\
\hline
\end{DoxyParams}
This function waits until the lock is acquired by the current process, unless an invalid lock attempt is performed.

The returned lock is a recursive lock\+: A lock attempt on a process already locked by the current process is accepted. All locks on the remote process have to be released to unlock the process.

\begin{DoxyNote}{Note}
To release the remote process, the returned lock has to be freed. See svm\+\_\+variable\+\_\+delete API function for more details.
\end{DoxyNote}
A lock will never be acquired on\+:
\begin{DoxyItemize}
\item the current process,
\item a dead process,
\item a process creating a circular dead lock.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
The process lock if the process is owned by the current process, or a NULL pointer otherwise.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
If a NULL pointer is returned by this function, any action on the process can lead to an undefined behavior.
\end{DoxyWarning}
Usage example\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{group__api__types_gabdebe955bb051d608ee64f9ddf2a24da}{SVM\_Process\_Lock}}\ lock\ =\ \mbox{\hyperlink{group__ownershipprocesses_ga535796c3203a2baa8095c951b9b2c205}{svm\_process\_ownership\_lock}}(svm,process);}
\DoxyCodeLine{\textcolor{keywordflow}{if}(\mbox{\hyperlink{group__ownershipprocesses_ga56f370208a3bafd6f00b4b0564ac2a67}{svm\_process\_ownership\_check}}(svm,process))}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ current\ process\ owns\ process:\ operations\ on\ process\ allowed}}
\DoxyCodeLine{\}}
\DoxyCodeLine{\textcolor{keywordflow}{if}(lock)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ lock\ retains\ process\ execution}}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ lock\ variable\ can\ now\ be\ safely\ set\ as\ global\ and/or\ shared,\ and\ stored}}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{//\ lock\ variable\ can\ be\ freed\ to\ release\ process\ execution}}
\DoxyCodeLine{\}}

\end{DoxyCode}



\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when this API function is called outside a waiting instruction.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__variables_ga5dba265f37ba41add5a7ffd7dfdb3243}{svm\+\_\+variable\+\_\+delete} 

\doxylink{group__ownershipprocesses_gaf4f992be8efbc074e1f4578fd0106bd6}{svm\+\_\+process\+\_\+ownership\+\_\+get\+\_\+local} 

\doxylink{group__ownershipprocesses_ga56f370208a3bafd6f00b4b0564ac2a67}{svm\+\_\+process\+\_\+ownership\+\_\+check} 
\end{DoxySeeAlso}
\Hypertarget{group__ownershipprocesses_gacf9cf341788aa84c0e84354958feaf50}\label{group__ownershipprocesses_gacf9cf341788aa84c0e84354958feaf50} 
\index{SVM process ownership@{SVM process ownership}!svm\_process\_ownership\_lock\_critical@{svm\_process\_ownership\_lock\_critical}}
\index{svm\_process\_ownership\_lock\_critical@{svm\_process\_ownership\_lock\_critical}!SVM process ownership@{SVM process ownership}}
\doxysubsubsubsection{\texorpdfstring{svm\_process\_ownership\_lock\_critical()}{svm\_process\_ownership\_lock\_critical()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__apimacros_ga0d0dae93534c2ba22499a92705a4e391}{SVM\+\_\+\+FUNCTION}} \mbox{\hyperlink{group__api__types_gabdebe955bb051d608ee64f9ddf2a24da}{SVM\+\_\+\+Process\+\_\+\+Lock}} svm\+\_\+process\+\_\+ownership\+\_\+lock\+\_\+critical (\begin{DoxyParamCaption}\item[{const void \texorpdfstring{$\ast$}{*}}]{svm }\end{DoxyParamCaption})}



This function locks all other processes. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em svm} & The SVM pointer passed as first argument of the callback function.\\
\hline
\end{DoxyParams}
This function locks all other processes for critical execution of code.

\begin{DoxyWarning}{Warning}
Use this function with caution, as it can block the virtual machine. It is also avised to limit the lock scope to the instruction creating the lock.
\end{DoxyWarning}
\begin{DoxyNote}{Note}
To release the all processes, the returned lock has to be freed. See svm\+\_\+variable\+\_\+delete API function for more details.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
The process lock if all other processes are locked by us, or a NULL pointer otherwise.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
If a NULL pointer is returned by this function, any critical action performed can lead to an undefined behavior.
\end{DoxyWarning}

\begin{DoxyExceptions}{Exceptions}
{\em FAILURE} & interruption when a parameter is incorrect. (Please refer to the main description page of this API.) \\
\hline
{\em FAILURE} & interruption when this API function is called outside a system waiting instruction.\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\doxylink{group__variables_ga5dba265f37ba41add5a7ffd7dfdb3243}{svm\+\_\+variable\+\_\+delete} 

\doxylink{group__ownershipprocesses_gaf4f992be8efbc074e1f4578fd0106bd6}{svm\+\_\+process\+\_\+ownership\+\_\+get\+\_\+local} 

\doxylink{group__ownershipprocesses_ga56f370208a3bafd6f00b4b0564ac2a67}{svm\+\_\+process\+\_\+ownership\+\_\+check} 
\end{DoxySeeAlso}
