Mstdlib-1.24.0

Typedefs

typedef M_uint64 M_thread_tls_key_t
 

Functions

M_thread_tls_key_t M_thread_tls_key_create (void(*destructor)(void *))
 
M_bool M_thread_tls_setspecific (M_thread_tls_key_t key, const void *value)
 
void * M_thread_tls_getspecific (M_thread_tls_key_t key)
 

Detailed Description

Thread Local Storage

Typedef Documentation

◆ M_thread_tls_key_t

typedef M_uint64 M_thread_tls_key_t

Thread local storage key.

Function Documentation

◆ M_thread_tls_key_create()

M_thread_tls_key_t M_thread_tls_key_create ( void(*)(void *)  destructor)

Create a key for storing data in thread local storage.

Parameters
destructorThe destructor to call to destroy the stored value at the returned key. Optional, use NULL if not needed.
Returns
The key to use in tls.

◆ M_thread_tls_setspecific()

M_bool M_thread_tls_setspecific ( M_thread_tls_key_t  key,
const void *  value 
)

Set the key for the current thread to the given value.

Parameters
[in]keyThe key.
[in]valueThe value to store.
Returns
M_TRUE if the value was stored. Otherwise M_FALSE.

◆ M_thread_tls_getspecific()

void * M_thread_tls_getspecific ( M_thread_tls_key_t  key)

Get the value fro a given key.

Parameters
[in]keyThe key.
Returns
The value or NULL if not value set/invalid key.