urcu/static/urcu-qsbr.h urcu/static/wfcqueue.h \
urcu/static/wfqueue.h urcu/static/wfstack.h \
urcu/static/urcu-mb.h urcu/static/urcu-memb.h \
- urcu/static/urcu-signal.h urcu/static/urcu-common.h \
+ urcu/static/urcu-signal.h urcu/static/urcu-signal-nr.h \
+ urcu/static/urcu-common.h \
urcu/tls-compat.h urcu/debug.h urcu/urcu.h urcu/urcu-bp.h \
urcu/call-rcu.h urcu/defer.h \
urcu/pointer.h urcu/urcu-qsbr.h urcu/flavor.h \
--- /dev/null
+#ifndef _STATIC_URCU_SIGNAL_NR_H
+#define _STATIC_URCU_SIGNAL_NR_H
+
+/*
+ * static/urcu-signal-nr.h
+ *
+ * Userspace RCU header.
+ *
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * IBM's contributions to this file may be relicensed under LGPLv2 or later.
+ */
+
+/*
+ * The signal number used by the RCU library can be overridden with
+ * -DSIGRCU= when compiling the library.
+ * Provide backward compatibility for liburcu 0.3.x SIGURCU.
+ */
+#ifdef SIGURCU
+#define SIGRCU SIGURCU
+#endif
+
+#ifndef SIGRCU
+#define SIGRCU SIGUSR1
+#endif
+
+#endif /* _STATIC_URCU_SIGNAL_NR_H */
#include <urcu/tls-compat.h>
#include <urcu/debug.h>
#include <urcu/static/urcu-common.h>
+#include <urcu/static/urcu-signal-nr.h>
#ifdef __cplusplus
extern "C" {
* This is required to permit relinking with newer versions of the library.
*/
-/*
- * The signal number used by the RCU library can be overridden with
- * -DSIGRCU= when compiling the library.
- * Provide backward compatibility for liburcu 0.3.x SIGURCU.
- */
-#ifdef SIGURCU
-#define SIGRCU SIGURCU
-#endif
-
-#ifndef SIGRCU
-#define SIGRCU SIGUSR1
-#endif
-
extern struct urcu_gp urcu_signal_gp;
extern DECLARE_URCU_TLS(struct urcu_reader, urcu_signal_reader);
#include <urcu/uatomic.h>
#include <urcu/compiler.h>
#include <urcu/rculfhash.h>
+#include <urcu/static/urcu-signal-nr.h>
#include <rculfhash-internal.h>
#include <stdio.h>
#include <pthread.h>
.after_fork_child = cds_lfht_after_fork_child,
};
-/* Block all signals to ensure we don't disturb the application. */
+/*
+ * Block all signals for the workqueue worker thread to ensure we don't
+ * disturb the application. The SIGRCU signal needs to be unblocked for
+ * the urcu-signal flavor.
+ */
static void cds_lfht_worker_init(struct urcu_workqueue *workqueue,
void *priv)
{
int ret;
sigset_t mask;
- /* Block signal for entire process, so only our thread processes it. */
ret = sigfillset(&mask);
if (ret)
urcu_die(errno);
- ret = pthread_sigmask(SIG_BLOCK, &mask, NULL);
+ ret = sigdelset(&mask, SIGRCU);
+ if (ret)
+ urcu_die(ret);
+ ret = pthread_sigmask(SIG_SETMASK, &mask, NULL);
if (ret)
urcu_die(ret);
}