DOKK / manpages / debian 10 / libcommoncpp2-doc / ost_ThreadKey.3.en
ost::ThreadKey(3) Library Functions Manual ost::ThreadKey(3)

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.

#include <thread.h>


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.


class ThreadImpl

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.

Create a unique thread specific container.

Destroy a thread specific container and any contents reserved.

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.

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.

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

Wed Oct 31 2018 GNU CommonC++