mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx-test: using std::atomic<> instead of sig_atomic_t.
Change-Id: I37d0c2768ec54ddd3c529d4b9a29f66df6ca265e
This commit is contained in:
parent
95199c754a
commit
2ee45b1820
@ -23,6 +23,8 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#ifndef MDBX_LOCKING
|
||||
#error "Opps, MDBX_LOCKING is undefined!"
|
||||
#endif
|
||||
@ -307,14 +309,14 @@ bool actor_config::osal_deserialize(const char *str, const char *end,
|
||||
|
||||
static pid_t overlord_pid;
|
||||
|
||||
static volatile sig_atomic_t sigusr1_head, sigusr2_head;
|
||||
static std::atomic<int> sigusr1_head, sigusr2_head;
|
||||
static void handler_SIGUSR(int signum) {
|
||||
switch (signum) {
|
||||
case SIGUSR1:
|
||||
sigusr1_head += 1;
|
||||
++sigusr1_head;
|
||||
return;
|
||||
case SIGUSR2:
|
||||
sigusr2_head += 1;
|
||||
++sigusr2_head;
|
||||
return;
|
||||
default:
|
||||
abort();
|
||||
@ -335,10 +337,10 @@ bool osal_progress_push(bool active) {
|
||||
|
||||
static std::unordered_map<pid_t, actor_status> childs;
|
||||
|
||||
static volatile sig_atomic_t sigalarm_head;
|
||||
static std::atomic<int> sigalarm_head;
|
||||
static void handler_SIGCHLD(int signum) {
|
||||
if (signum == SIGALRM)
|
||||
sigalarm_head += 1;
|
||||
++sigalarm_head;
|
||||
}
|
||||
|
||||
mdbx_pid_t osal_getpid(void) { return getpid(); }
|
||||
|
Loading…
Reference in New Issue
Block a user