A key is an identifier used to specify a storage location where the thing stored is different for each thread.
More...
#include <cpp_pthreads/key.h>
|
typedef void(* | Destructor_t )(void *) |
| type of a function which is used to destroy the object if the object is not null when the key is destroyed More...
|
|
|
int | create (Destructor_t destruct=0) |
| create a key that can be used to identify per-thread specific objects More...
|
|
int | destroy () |
| destroy the key, call destructor on data if it is set and data is not null More...
|
|
void * | getSpecific () |
| return the data associated with this key that belongs to this thread More...
|
|
int | setSpecific (void *value) |
| set this threads data in the box associated with this key More...
|
|
A key is an identifier used to specify a storage location where the thing stored is different for each thread.
Definition at line 36 of file key.h.
typedef void(* pthreads::Key::Destructor_t)(void *) |
type of a function which is used to destroy the object if the object is not null when the key is destroyed
Definition at line 40 of file key.h.
create a key that can be used to identify per-thread specific objects
- Parameters
-
destruct | destructor which is called on any non-null data when this key is destroyed |
int pthreads::Key::destroy |
( |
| ) |
|
destroy the key, call destructor on data if it is set and data is not null
void* pthreads::Key::getSpecific |
( |
| ) |
|
return the data associated with this key that belongs to this thread
int pthreads::Key::setSpecific |
( |
void * |
value | ) |
|
set this threads data in the box associated with this key
pthread_key_t pthreads::Key::m_data |
|
private |
Definition at line 43 of file key.h.
The documentation for this class was generated from the following file:
- include/cpp_pthreads/key.h