pthread_tls.h File Reference

RIOT POSIX thread local storage. More...

Detailed Description

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

typedef struct __pthread_tls_key * pthread_key_t
 A thread-specific key.
 
void * pthread_getspecific (pthread_key_t key)
 Returns the requested tls. More...
 
int pthread_setspecific (pthread_key_t key, const void *value)
 Set and binds a specific tls to a key. More...
 
int pthread_key_create (pthread_key_t *key, void(*destructor)(void *))
 Creates a new key to be used to identify a specific tls. More...
 
int pthread_key_delete (pthread_key_t key)
 Deletes a pthread_key_t that was previously created with pthread_key_create. More...
 
void __pthread_keys_exit (int self_id)
 Destroys all thread-specific keys for pthread self_id. More...
 
struct __pthread_tls_datum ** __pthread_get_tls_head (int self_id) PURE
 Returns the pointer to the head of the list of thread-specific data.
 

Function Documentation

◆ __pthread_keys_exit()

void __pthread_keys_exit ( int  self_id)

Destroys all thread-specific keys for pthread self_id.

Parameters
[in]self_idthe result of pthread_self().

◆ pthread_getspecific()

void* pthread_getspecific ( pthread_key_t  key)

Returns the requested tls.

Parameters
[in]keythe identifier for the requested tls
Returns
returns pointer to the storage on success, a 0 value otherwise

◆ pthread_key_create()

int pthread_key_create ( pthread_key_t key,
void(*)(void *)  destructor 
)

Creates a new key to be used to identify a specific tls.

Parameters
[out]keythe created key is scribed to the given pointer
[in]destructorfunction pointer called when non NULL just befor the pthread exits
Returns
returns 0 on success, an errorcode otherwise

◆ pthread_key_delete()

int pthread_key_delete ( pthread_key_t  key)

Deletes a pthread_key_t that was previously created with pthread_key_create.

does not call the destructor of the key

Parameters
[in]keythe identifier of the key to be deleted
Returns
returns 0 on success, an errorcode otherwise

◆ pthread_setspecific()

int pthread_setspecific ( pthread_key_t  key,
const void *  value 
)

Set and binds a specific tls to a key.

Parameters
[in]keythe identifier for the tls
[in]valuepointer to the location of the tls
Returns
returns 0 on success, an errorcode otherwise