WG14 threadsafe signals
Loading...
Searching...
No Matches
tss_async_signal_safe.h
Go to the documentation of this file.
1/* Proposed WG14 improved signals support
2(C) 2024 Niall Douglas <http://www.nedproductions.biz/>
3File Created: Nov 2024
4
5
6Licensed under the Apache License, Version 2.0 (the "License");
7you may not use this file except in compliance with the License.
8You may obtain a copy of the License in the accompanying file
9Licence.txt or at
10
11http://www.apache.org/licenses/LICENSE-2.0
12
13Unless required by applicable law or agreed to in writing, software
14distributed under the License is distributed on an "AS IS" BASIS,
15WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16See the License for the specific language governing permissions and
17limitations under the License.
18*/
19
20#ifndef WG14_SIGNALS_ASYNC_SIGNAL_SAFE_TLS_H
21#define WG14_SIGNALS_ASYNC_SIGNAL_SAFE_TLS_H
22
23#include "config.h"
24
25#ifdef __cplusplus
26extern "C"
27{
28#endif
29
31 typedef struct WG14_SIGNALS_PREFIX(tss_async_signal_safe) *
32 WG14_SIGNALS_PREFIX(tss_async_signal_safe);
33
35 struct WG14_SIGNALS_PREFIX(tss_async_signal_safe_attr)
36 {
37 int (*const create)(void **dest);
38 int (*const destroy)(void *v);
39 };
40
43 WG14_SIGNALS_PREFIX(tss_async_signal_safe) * val,
44 const struct WG14_SIGNALS_PREFIX(tss_async_signal_safe_attr) * attr);
45
48 WG14_SIGNALS_PREFIX(tss_async_signal_safe) val);
49
60 WG14_SIGNALS_EXTERN int WG14_SIGNALS_PREFIX(
62 val);
63
68 WG14_SIGNALS_PREFIX(tss_async_signal_safe) val);
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif
#define WG14_SIGNALS_EXTERN
Definition config.h:85
void * tss_async_signal_safe_get(tss_async_signal_safe val)
THREADSAFE ASYNC-SIGNAL-SAFE Get the thread local value for the current thread.
int tss_async_signal_safe_destroy(tss_async_signal_safe val)
Destroy an async signal safe thread local instance.
struct tss_async_signal_safe * tss_async_signal_safe
The type of an async signal safe thread local.
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_thread_init(tss_async_signal_safe val)
THREADSAFE Initialise an async signal safe thread local instance for a specific thread.