Adelsbach Enhanced Threading Library

Manual Pages (DD-00013-001)

Enhanced Threading Library > tss_create (3)
HTML TXT PDF PS
tss_create(3) Library Functions Manual tss_create(3)

tss_createcreate a thread specific data key

library “threads”
#include <threads.h>

typedef void (*tss_dtor_t)(void*);

int
tss_create(tss_t *key, tss_dtor_t dtor);

The function () will create a thread-specific data key which is visible to all threads in the process.

The data is by default initialized as NULL for all active threads. Any new thread that is being created will have it's value also initialized as NULL.

An optional destructor dtor can be specified which will called at the exit of thread if the thread-specific data is not NULL. The order of the destructors being called is arbitrary.

Upon success tss_create() returns thrd_success, otherwise thrd_error will be returned.

tss_get(3) tss_set(3) tss_delete(3)

The tss_create() function first appeared in the C11 standard ISO/IEC 9899:2011.

Jan Adelsbach <jan@jadelsbach.de>

May 9, 2020 Debian