tss_create(3) | Library Functions Manual | tss_create(3) |
NAME
tss_create
—
create a thread specific data key
SYNOPSIS
library “threads”
#include <threads.h>
typedef void (*tss_dtor_t)(void*);
int
tss_create
(tss_t
*key, tss_dtor_t
dtor);
DESCRIPTION
The function
tss_create
()
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.
RETURN VALUES
Upon success tss_create
() returns
thrd_success, otherwise
thrd_error will be returned.
SEE ALSO
HISTORY
The tss_create
() function first appeared
in the C11 standard ISO/IEC 9899:2011.
AUTHORS
Jan Adelsbach <jan@jadelsbach.de>
May 9, 2020 | Debian |