+// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation.
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
#ifndef _URCU_BP_H
#define _URCU_BP_H
/*
- * urcu-bp.h
- *
* Userspace RCU header, "bulletproof" version.
*
* Slower RCU read-side adapted for tracing library. Does not require thread
* registration nor unregistration. Also signal-safe.
*
- * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
- *
* LGPL-compatible code should include this header with :
*
* #define _LGPL_SOURCE
* #include <urcu.h>
*
- * 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.
*/
#include <stdlib.h>
#include <pthread.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <stdbool.h>
#include <urcu/map/urcu-bp.h>
*/
/*
- * See urcu-pointer.h and urcu/static/urcu-pointer.h for pointer
+ * See urcu/pointer.h and urcu/static/pointer.h for pointer
* publication headers.
*/
-#include <urcu-pointer.h>
+#include <urcu/pointer.h>
+#include <urcu/urcu-poll.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef _LGPL_SOURCE
/*
* library wrappers to be used by non-LGPL compatible source code.
- * See LGPL-only urcu/static/urcu-pointer.h for documentation.
+ * See LGPL-only urcu/static/pointer.h for documentation.
*/
extern void urcu_bp_read_lock(void);
extern void urcu_bp_synchronize_rcu(void);
+/*
+ * RCU grace period polling API.
+ */
+extern struct urcu_gp_poll_state urcu_bp_start_poll_synchronize_rcu(void);
+extern bool urcu_bp_poll_state_synchronize_rcu(struct urcu_gp_poll_state state);
+
/*
* urcu_bp_before_fork, urcu_bp_after_fork_parent and urcu_bp_after_fork_child
* should be called around fork() system calls when the child process is not
extern void urcu_bp_after_fork_child(void);
/*
- * In the bulletproof version, the following functions are no-ops.
+ * In the bulletproof version, thread registration is performed lazily,
+ * but it can be forced by issuing an explicit urcu_bp_register_thread().
*/
-static inline void urcu_bp_register_thread(void)
-{
-}
+extern void urcu_bp_register_thread(void);
+/*
+ * In the bulletproof version, the following functions are no-ops.
+ */
static inline void urcu_bp_unregister_thread(void)
{
}
}
#endif
-#include <urcu-call-rcu.h>
-#include <urcu-defer.h>
-#include <urcu-flavor.h>
+#include <urcu/call-rcu.h>
+#include <urcu/defer.h>
+#include <urcu/flavor.h>
#ifndef URCU_API_MAP
#include <urcu/map/clear.h>