diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2019-02-11 11:38:57 +0100 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2019-02-11 15:49:49 -0200 |
| commit | c8a65463b20c00b3fd635eb4ca97f3b53927c0f9 (patch) | |
| tree | 1e11fbf6b84f7a9ea2041e116dc634ac190c3f92 /lib/thread.h | |
| parent | be566e4e45aed586716958a1c4adeb00cc352bc0 (diff) | |
lib: make atomic ops C++ compatible
C++ doesn't have ISO C11 stdatomic.h or "_Atomic inttype", so use
std::atomic instead to get the headers compatible.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/thread.h')
| -rw-r--r-- | lib/thread.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/thread.h b/lib/thread.h index f404d92755..036e39f77e 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -119,13 +119,13 @@ struct thread { struct cpu_thread_history { int (*func)(struct thread *); - _Atomic unsigned int total_calls; - _Atomic unsigned int total_active; + atomic_uint_fast32_t total_calls; + atomic_uint_fast32_t total_active; struct time_stats { - _Atomic unsigned long total, max; + atomic_size_t total, max; } real; struct time_stats cpu; - _Atomic uint32_t types; + atomic_uint_fast32_t types; const char *funcname; }; |
