|
WG14 threadsafe signals
|
#include "config.h"
Go to the source code of this file.
Classes | |
| struct | tss_async_signal_safe_attr |
| The attributes for creating an async signal safe thread local. More... | |
Typedefs | |
| typedef struct tss_async_signal_safe_s * | tss_async_signal_safe |
| The type of an async signal safe thread local. | |
Functions | |
| int | tss_async_signal_safe_create (tss_async_signal_safe *val, const struct tss_async_signal_safe_attr *attr) |
| Create an async signal safe thread local instance. | |
| int | tss_async_signal_safe_destroy (tss_async_signal_safe val) |
| Destroy an async signal safe thread local instance. | |
| int | tss_async_signal_safe_thread_init (tss_async_signal_safe val) |
| THREADSAFE Initialise an async signal safe thread local instance for a specific thread. | |
| void * | tss_async_signal_safe_get (tss_async_signal_safe val) |
| THREADSAFE ASYNC-SIGNAL-SAFE Get the thread local value for the current thread. | |
| typedef struct tss_async_signal_safe_s* tss_async_signal_safe |
The type of an async signal safe thread local.
Definition at line 32 of file tss_async_signal_safe.h.
|
extern |
Create an async signal safe thread local instance.
|
extern |
Destroy an async signal safe thread local instance.
All threads that initialised this instance must have exited (e.g. been joined) before this is called: a thread's exit-time deinitialisation handler may still access the instance otherwise.
Calling this function twice on the same value is undefined behaviour: the value is left dangling after this returns, and this reference implementation deliberately does not guard against its reuse (the C11 tss_delete / POSIX pthread_key_delete contract likewise leaves a second deletion undefined; plans/analysis.md TSSD). Zero the value after destroying it if it might be destroyed again.
|
extern |
THREADSAFE ASYNC-SIGNAL-SAFE Get the thread local value for the current thread.
|
extern |
THREADSAFE Initialise an async signal safe thread local instance for a specific thread.
The initialisation and registration of a thread local state for a specific thread is not async signal safe, and so must be manually performed by each thread before use of an async signal safe thread local instance. Call this function somewhere near the beginning of your thread instance.
It is safe to call this functions many times in a thread.