Template:c/thread/tss example
From cppreference.com
| This section is incomplete Reason: improve, perhaps look for POSIX examples for inspiration |
int thread_func(void *arg) {
tss_t key;
if (thrd_success == tss_create(&key, free)) {
tss_set(key, malloc(4)); // stores a pointer on TSS
// ...
}
} // calls free() for the pointer stored on TSS