Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 785

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Thread\-Key Class Reference}
\label{classost_1_1_thread_key}\index{ost::ThreadKey@{ost::ThreadKey}}
This class allows the creation of a thread context unique \char`\"{}pointer\char`\"{} that can be set and retrieved and can be used to create thread specific data areas for implementing \char`\"{}thread safe\char`\"{} library routines.container for thread specific data storage.  


{\tt \#include $<$thread.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Thread\-Key} ()
\begin{CompactList}\small\item\em Create a unique thread specific container. \item\end{CompactList}\item 
virtual {\bf $\sim$Thread\-Key} ()
\begin{CompactList}\small\item\em Destroy a thread specific container and any contents reserved. \item\end{CompactList}\item 
void $\ast$ {\bf get\-Key} (void)
\begin{CompactList}\small\item\em Get the value of the pointer for the thread specific data container. \item\end{CompactList}\item 
void {\bf set\-Key} (void $\ast$)
\begin{CompactList}\small\item\em Set the value of the pointer for the current thread specific execution context. \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Thread\-Impl}
\end{CompactItemize}


\subsection{Detailed Description}
This class allows the creation of a thread context unique \char`\"{}pointer\char`\"{} that can be set and retrieved and can be used to create thread specific data areas for implementing \char`\"{}thread safe\char`\"{} library routines.container for thread specific data storage. 

Finally, Common C++ supports a thread-safe \char`\"{}Atomic\-Counter\char`\"{} class. This can often be used for reference counting without having to protect the counter with a separate {\bf Mutex}{\rm (p.\,\pageref{classost_1_1_mutex})} counter. This lends to lighter-weight code.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::ThreadKey@{ost::Thread\-Key}!ThreadKey@{ThreadKey}}
\index{ThreadKey@{ThreadKey}!ost::ThreadKey@{ost::Thread\-Key}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Thread\-Key::Thread\-Key ()}\label{classost_1_1_thread_key_043483c6c7621ecea587d7c241dea50c}


Create a unique thread specific container. 

\index{ost::ThreadKey@{ost::Thread\-Key}!~ThreadKey@{$\sim$ThreadKey}}
\index{~ThreadKey@{$\sim$ThreadKey}!ost::ThreadKey@{ost::Thread\-Key}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ost::Thread\-Key::$\sim$Thread\-Key ()\hspace{0.3cm}{\tt  [virtual]}}\label{classost_1_1_thread_key_e2450333089e61ce432377977fc1e337}


Destroy a thread specific container and any contents reserved. 



\subsection{Member Function Documentation}
\index{ost::ThreadKey@{ost::Thread\-Key}!getKey@{getKey}}
\index{getKey@{getKey}!ost::ThreadKey@{ost::Thread\-Key}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ ost::Thread\-Key::get\-Key (void)}\label{classost_1_1_thread_key_3b59c3887d643ce80af170663cb2551c}


Get the value of the pointer for the thread specific data container. 

A unique pointer can be set for each execution context.

\begin{Desc}
\item[Returns:]a unique void $\ast$ for each execution context. \end{Desc}
\index{ost::ThreadKey@{ost::Thread\-Key}!setKey@{setKey}}
\index{setKey@{setKey}!ost::ThreadKey@{ost::Thread\-Key}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void ost::Thread\-Key::set\-Key (void $\ast$)}\label{classost_1_1_thread_key_5569af7b992aa2fb67da7711225c99a6}


Set the value of the pointer for the current thread specific execution context. 

This can be used to store thread context specific data.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em -}]ptr to thread context specific data. \end{description}
\end{Desc}


\subsection{Friends And Related Function Documentation}
\index{ost::ThreadKey@{ost::Thread\-Key}!ThreadImpl@{ThreadImpl}}
\index{ThreadImpl@{ThreadImpl}!ost::ThreadKey@{ost::Thread\-Key}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}friend class Thread\-Impl\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_thread_key_e3c1cdb20d70b22a5c0bf395614eefff}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf thread.h}\end{CompactItemize}