Poster of Linux kernelThe best gift for a Linux geek
ost::ThreadKey

ost::ThreadKey

Section: C Library Functions (3) Updated: 16 Feb 2010
Local index Up
 

NAME

ost::ThreadKey -

This class allows the creation of a thread context unique 'pointer' that can be set and retrieved and can be used to create thread specific data areas for implementing 'thread safe' library routines.

 

SYNOPSIS


#include <thread.h>  

Public Member Functions


ThreadKey ()
Create a unique thread specific container.
virtual ~ThreadKey ()
Destroy a thread specific container and any contents reserved.
void * getKey (void)
Get the value of the pointer for the thread specific data container.
void setKey (void *)
Set the value of the pointer for the current thread specific execution context.  

Friends


class ThreadImpl
 

Detailed Description

This class allows the creation of a thread context unique 'pointer' that can be set and retrieved and can be used to create thread specific data areas for implementing 'thread safe' library routines.

Finally, Common C++ supports a thread-safe 'AtomicCounter' class. This can often be used for reference counting without having to protect the counter with a separate Mutex counter. This lends to lighter-weight code.

Author:

David Sugar <dyfet@ostel.com> container for thread specific data storage.

 

Constructor & Destructor Documentation

 

ost::ThreadKey::ThreadKey ()

Create a unique thread specific container.  

virtual ost::ThreadKey::~ThreadKey () [virtual]

Destroy a thread specific container and any contents reserved.  

Member Function Documentation

 

void* ost::ThreadKey::getKey (void)

Get the value of the pointer for the thread specific data container. A unique pointer can be set for each execution context.

Returns:

a unique void * for each execution context.

 

void ost::ThreadKey::setKey (void *)

Set the value of the pointer for the current thread specific execution context. This can be used to store thread context specific data.

Parameters:

- ptr to thread context specific data.

 

Friends And Related Function Documentation

 

friend class ThreadImpl [friend]

 

Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Friends
Detailed Description
Constructor & Destructor Documentation
ost::ThreadKey::ThreadKey ()
virtual ost::ThreadKey::~ThreadKey () [virtual]
Member Function Documentation
void* ost::ThreadKey::getKey (void)
void ost::ThreadKey::setKey (void *)
Friends And Related Function Documentation
friend class ThreadImpl [friend]
Author

This document was created by man2html, using the manual pages.
Time: 21:51:52 GMT, April 16, 2011