WG14 threadsafe signals
Toggle main menu visibility
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/>
3
File Created: Nov 2024
4
5
6
Licensed under the Apache License, Version 2.0 (the "License");
7
you may not use this file except in compliance with the License.
8
You may obtain a copy of the License in the accompanying file
9
Licence.txt or at
10
11
http://www.apache.org/licenses/LICENSE-2.0
12
13
Unless required by applicable law or agreed to in writing, software
14
distributed under the License is distributed on an "AS IS" BASIS,
15
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
See the License for the specific language governing permissions and
17
limitations 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
26
extern
"C"
27
{
28
#endif
29
31
typedef
struct
WG14_SIGNALS_PREFIX(tss_async_signal_safe_s) *
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
42
WG14_SIGNALS_EXTERN
int
WG14_SIGNALS_PREFIX(
tss_async_signal_safe_create
)(
43
WG14_SIGNALS_PREFIX(
tss_async_signal_safe
) * val,
44
const
struct
WG14_SIGNALS_PREFIX(tss_async_signal_safe_attr) * attr);
45
47
WG14_SIGNALS_EXTERN
int
WG14_SIGNALS_PREFIX(
tss_async_signal_safe_destroy
)(
48
WG14_SIGNALS_PREFIX(
tss_async_signal_safe
) val);
49
60
WG14_SIGNALS_EXTERN
int
WG14_SIGNALS_PREFIX(
61
tss_async_signal_safe_thread_init
)(WG14_SIGNALS_PREFIX(
tss_async_signal_safe
)
62
val);
63
67
WG14_SIGNALS_EXTERN
void
*WG14_SIGNALS_PREFIX(
tss_async_signal_safe_get
)(
68
WG14_SIGNALS_PREFIX(
tss_async_signal_safe
) val);
69
70
#ifdef __cplusplus
71
}
72
#endif
73
74
#if WG14_SIGNALS_ENABLE_HEADER_ONLY
75
#include "detail/impl/tss_async_signal_safe.c.ipp"
76
#endif
77
78
#endif
config.h
WG14_SIGNALS_EXTERN
#define WG14_SIGNALS_EXTERN
Definition
config.h:113
tss_async_signal_safe_attr::create
int(*const create)(void **dest)
Create an instance.
Definition
tss_async_signal_safe.h:37
tss_async_signal_safe_attr::destroy
int(*const destroy)(void *v)
Destroy an instance.
Definition
tss_async_signal_safe.h:38
tss_async_signal_safe_get
void * tss_async_signal_safe_get(tss_async_signal_safe val)
THREADSAFE ASYNC-SIGNAL-SAFE Get the thread local value for the current thread.
tss_async_signal_safe_destroy
int tss_async_signal_safe_destroy(tss_async_signal_safe val)
Destroy an async signal safe thread local instance.
tss_async_signal_safe_create
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.
tss_async_signal_safe_thread_init
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.
tss_async_signal_safe
struct tss_async_signal_safe_s * tss_async_signal_safe
The type of an async signal safe thread local.
Definition
tss_async_signal_safe.h:31
include
wg14_signals
tss_async_signal_safe.h
Generated by
1.17.0