Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Thursday, June 13, 2019
 
 

tss_create(3C)

Name

tss_create, tss_delete, tss_set, tss_get - C11 thread-specific storage functions

Synopsis

#include <threads.h>
int tss_create(tss_t *key, tss_dtor_t dtor);
void tss_delete(tss_t key);
int tss_set(tss_t key, void *val);
void *tss_get(tss_t key);

Description

The tss_create(), tss_delete(), tss_set(), and tss_get() functions are part of the threads interfaces as specified in the C11 standard. They are simple wrappers over the more general pthreads functions. See INCITS/ISO/IEC 9899:2011.

C11 Threads
POSIX Threads
tss_create()
pthread_key_create()
tss_delete()
pthread_key_delete()
tss_set()
pthread_setspecific()
tss_get()
pthread_getspecific()

Return Values

Upon successful completion, the tss_create() and tss_set() functions return 0, otherwise thrd_error is returned.

Upon successful completion, the tss_get() function returns the value for the current thread, otherwise, it returns NULL.

No value is returned by the tss_delete() function.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See Also

pthread_getspecific(3C), pthread_key_create(3C), pthread_key_delete(3C), pthread_setspecific(3C), threads.h(3HEAD), attributes(7)