\hypertarget{thread_8h}{
\section{thread.h File Reference}
\label{thread_8h}\index{thread.h@{thread.h}}
}
{\tt \#include $<$pthread.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{thread_8h_0d34536ac0be4d7b71e30a3247a3baaf}{THREAD\_\-STACK}~524288
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{thread_8h_b9eea8d7684bb197db47f7a8e11a2c58}{jack\_\-acquire\_\-real\_\-time\_\-scheduling} (pthread\_\-t thread, int priority)
\item 
int \hyperlink{thread_8h_6df7e89bafddeddb718b8d9e06200b70}{jack\_\-client\_\-create\_\-thread} (\hyperlink{types_8h_44245b219e977ef0a840ee16dbd95b50}{jack\_\-client\_\-t} $\ast$\hyperlink{simple__client_8c_62608e08adc29a8d6dbc9754e659f125}{client}, pthread\_\-t $\ast$thread, int priority, int realtime, void $\ast$($\ast$start\_\-routine)(void $\ast$), void $\ast$arg)
\item 
int \hyperlink{thread_8h_b1dda2c872205bb4e823567c6b900390}{jack\_\-drop\_\-real\_\-time\_\-scheduling} (pthread\_\-t thread)
\end{CompactItemize}


\subsection{Detailed Description}
Library functions to standardize thread creation for JACK and its clients. These interfaces hide some system variations in the handling of realtime scheduling and associated privileges. 

\subsection{Define Documentation}
\hypertarget{thread_8h_0d34536ac0be4d7b71e30a3247a3baaf}{
\index{thread.h@{thread.h}!THREAD_STACK@{THREAD\_\-STACK}}
\index{THREAD_STACK@{THREAD\_\-STACK}!thread.h@{thread.h}}
\subsubsection[THREAD\_\-STACK]{\setlength{\rightskip}{0pt plus 5cm}\#define THREAD\_\-STACK~524288}}
\label{thread_8h_0d34536ac0be4d7b71e30a3247a3baaf}




\subsection{Function Documentation}
\hypertarget{thread_8h_b9eea8d7684bb197db47f7a8e11a2c58}{
\index{thread.h@{thread.h}!jack_acquire_real_time_scheduling@{jack\_\-acquire\_\-real\_\-time\_\-scheduling}}
\index{jack_acquire_real_time_scheduling@{jack\_\-acquire\_\-real\_\-time\_\-scheduling}!thread.h@{thread.h}}
\subsubsection[jack\_\-acquire\_\-real\_\-time\_\-scheduling]{\setlength{\rightskip}{0pt plus 5cm}int jack\_\-acquire\_\-real\_\-time\_\-scheduling (pthread\_\-t {\em thread}, int {\em priority})}}
\label{thread_8h_b9eea8d7684bb197db47f7a8e11a2c58}


Attempt to enable realtime scheduling for a thread. On some systems that may require special privileges.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em thread}]POSIX thread ID. \item[{\em priority}]requested thread priority.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0, if successful; EPERM, if the calling process lacks required realtime privileges; otherwise some other error number. \end{Desc}
\hypertarget{thread_8h_6df7e89bafddeddb718b8d9e06200b70}{
\index{thread.h@{thread.h}!jack_client_create_thread@{jack\_\-client\_\-create\_\-thread}}
\index{jack_client_create_thread@{jack\_\-client\_\-create\_\-thread}!thread.h@{thread.h}}
\subsubsection[jack\_\-client\_\-create\_\-thread]{\setlength{\rightskip}{0pt plus 5cm}int jack\_\-client\_\-create\_\-thread (\hyperlink{types_8h_44245b219e977ef0a840ee16dbd95b50}{jack\_\-client\_\-t} $\ast$ {\em client}, pthread\_\-t $\ast$ {\em thread}, int {\em priority}, int {\em realtime}, void $\ast$($\ast$)(void $\ast$) {\em start\_\-routine}, void $\ast$ {\em arg})}}
\label{thread_8h_6df7e89bafddeddb718b8d9e06200b70}


Create a thread for JACK or one of its clients. The thread is created executing {\em start\_\-routine\/} with {\em arg\/} as its sole argument.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em client}]the JACK client for whom the thread is being created. May be NULL if the client is being created within the JACK server. \item[{\em thread}]place to return POSIX thread ID. \item[{\em priority}]thread priority, if realtime. \item[{\em realtime}]true for the thread to use realtime scheduling. On some systems that may require special privileges. \item[{\em start\_\-routine}]function the thread calls when it starts. \item[{\em arg}]parameter passed to the {\em start\_\-routine\/}.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0, if successful; otherwise some error number. \end{Desc}
\hypertarget{thread_8h_b1dda2c872205bb4e823567c6b900390}{
\index{thread.h@{thread.h}!jack_drop_real_time_scheduling@{jack\_\-drop\_\-real\_\-time\_\-scheduling}}
\index{jack_drop_real_time_scheduling@{jack\_\-drop\_\-real\_\-time\_\-scheduling}!thread.h@{thread.h}}
\subsubsection[jack\_\-drop\_\-real\_\-time\_\-scheduling]{\setlength{\rightskip}{0pt plus 5cm}int jack\_\-drop\_\-real\_\-time\_\-scheduling (pthread\_\-t {\em thread})}}
\label{thread_8h_b1dda2c872205bb4e823567c6b900390}


Drop realtime scheduling for a thread.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em thread}]POSIX thread ID.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0, if successful; otherwise an error number. \end{Desc}
