#define HA_RWLOCK_TRYRDLOCK(lbl, l) ({ 0; })
#define HA_RWLOCK_RDUNLOCK(lbl, l) do { /* do nothing */ } while(0)
+#define ha_sigmask(how, set, oldset) sigprocmask(how, set, oldset)
+
+
static inline void __ha_barrier_load(void)
{
}
extern unsigned long all_threads_mask;
+#define ha_sigmask(how, set, oldset) pthread_sigmask(how, set, oldset)
+
+
#if defined(DEBUG_THREAD) || defined(DEBUG_FULL)
/* WARNING!!! if you update this enum, please also keep lock_label() up to date below */
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGCHLD);
- assert(sigprocmask(SIG_BLOCK, &set, NULL) == 0);
+ assert(ha_sigmask(SIG_BLOCK, &set, NULL) == 0);
}
void unblock_sigchld(void)
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGCHLD);
- assert(sigprocmask(SIG_UNBLOCK, &set, NULL) == 0);
+ assert(ha_sigmask(SIG_UNBLOCK, &set, NULL) == 0);
}
static struct pid_list *pid_list_add(pid_t pid, struct task *t)
sigaddset(&set, SIGHUP);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGTERM);
- sigprocmask(SIG_SETMASK, &set, NULL);
+ ha_sigmask(SIG_SETMASK, &set, NULL);
}
static void mworker_unblock_signals()
sigaddset(&set, SIGHUP);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGTERM);
- sigprocmask(SIG_UNBLOCK, &set, NULL);
+ ha_sigmask(SIG_UNBLOCK, &set, NULL);
}
static void mworker_unregister_signals()
#include <signal.h>
#include <string.h>
+#include <common/hathreads.h>
+
#include <proto/signal.h>
#include <proto/log.h>
#include <proto/task.h>
sigset_t old_sig;
/* block signal delivery during processing */
- sigprocmask(SIG_SETMASK, &blocked_sig, &old_sig);
+ ha_sigmask(SIG_SETMASK, &blocked_sig, &old_sig);
/* It is important that we scan the queue forwards so that we can
* catch any signal that would have been queued by another signal
signal_queue_len = 0;
/* restore signal delivery */
- sigprocmask(SIG_SETMASK, &old_sig, NULL);
+ ha_sigmask(SIG_SETMASK, &old_sig, NULL);
}
/* perform minimal intializations, report 0 in case of error, 1 if OK. */
* parsing We don't want the process to be killed by an unregistered
* USR2 signal when the master-worker is reloading */
sigaddset(&blocked_sig, SIGUSR2);
- sigprocmask(SIG_SETMASK, &blocked_sig, NULL);
+ ha_sigmask(SIG_SETMASK, &blocked_sig, NULL);
sigfillset(&blocked_sig);
sigdelset(&blocked_sig, SIGPROF);