| SDL_SetTLS(3) | SDL3 FUNCTIONS | SDL_SetTLS(3) |
SDL_SetTLS - Set the current thread's value associated with a thread local storage ID.
Defined in SDL3/SDL_thread.h
#include "SDL3/SDL.h"
bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
If the thread local storage ID is not initialized (the value is 0), a new ID will be created in a thread-safe way, so all calls using a pointer to the same ID will refer to the same local storage.
Note that replacing a value from a previous call to this function on the same thread does _not_ call the previous value's destructor! destructor can be NULL; it is assumed that value does not need to be cleaned up if so.
Returns true on success or false on failure; call
SDL_GetError () for more information.
It is safe to call this function from any thread.
This function is available since SDL 3.2.0.
•(3), SDL_GetTLS(3)
| SDL 3.2.10 | Simple Directmedia Layer |