#include <urcu/config.h>
#if defined(DEBUG_RCU) || defined(CONFIG_RCU_DEBUG)
-#define urcu_assert(...) assert(__VA_ARGS__)
+# define urcu_assert_debug(...) assert(__VA_ARGS__)
#else
-#define urcu_assert(...)
+# define urcu_assert_debug(...)
#endif
+/*
+ * For backward compatibility reasons, this file must expose the urcu_assert()
+ * macro.
+ */
+#define urcu_assert(_cond) urcu_assert_debug(_cond)
+
#endif /* _URCU_DEBUG_H */
urcu_bp_register(); /* If not yet registered. */
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
tmp = URCU_TLS(urcu_bp_reader)->ctr;
- urcu_assert((tmp & URCU_BP_GP_CTR_NEST_MASK) != URCU_BP_GP_CTR_NEST_MASK);
+ urcu_assert_debug((tmp & URCU_BP_GP_CTR_NEST_MASK) != URCU_BP_GP_CTR_NEST_MASK);
_urcu_bp_read_lock_update(tmp);
}
unsigned long tmp;
tmp = URCU_TLS(urcu_bp_reader)->ctr;
- urcu_assert(tmp & URCU_BP_GP_CTR_NEST_MASK);
+ urcu_assert_debug(tmp & URCU_BP_GP_CTR_NEST_MASK);
/* Finish using rcu before decrementing the pointer. */
urcu_bp_smp_mb_slave();
_CMM_STORE_SHARED(URCU_TLS(urcu_bp_reader)->ctr, tmp - URCU_BP_GP_COUNT);
{
unsigned long tmp;
- urcu_assert(URCU_TLS(urcu_mb_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_mb_reader).registered);
cmm_barrier();
tmp = URCU_TLS(urcu_mb_reader).ctr;
- urcu_assert((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK);
+ urcu_assert_debug((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK);
_urcu_mb_read_lock_update(tmp);
}
{
unsigned long tmp;
- urcu_assert(URCU_TLS(urcu_mb_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_mb_reader).registered);
tmp = URCU_TLS(urcu_mb_reader).ctr;
- urcu_assert(tmp & URCU_GP_CTR_NEST_MASK);
+ urcu_assert_debug(tmp & URCU_GP_CTR_NEST_MASK);
_urcu_mb_read_unlock_update_and_wakeup(tmp);
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
}
{
unsigned long tmp;
- urcu_assert(URCU_TLS(urcu_memb_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_memb_reader).registered);
cmm_barrier();
tmp = URCU_TLS(urcu_memb_reader).ctr;
- urcu_assert((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK);
+ urcu_assert_debug((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK);
_urcu_memb_read_lock_update(tmp);
}
{
unsigned long tmp;
- urcu_assert(URCU_TLS(urcu_memb_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_memb_reader).registered);
tmp = URCU_TLS(urcu_memb_reader).ctr;
- urcu_assert(tmp & URCU_GP_CTR_NEST_MASK);
+ urcu_assert_debug(tmp & URCU_GP_CTR_NEST_MASK);
_urcu_memb_read_unlock_update_and_wakeup(tmp);
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
}
*/
static inline void _urcu_qsbr_read_lock(void)
{
- urcu_assert(URCU_TLS(urcu_qsbr_reader).ctr);
+ urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).ctr);
}
/*
*/
static inline void _urcu_qsbr_read_unlock(void)
{
- urcu_assert(URCU_TLS(urcu_qsbr_reader).ctr);
+ urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).ctr);
}
/*
{
unsigned long gp_ctr;
- urcu_assert(URCU_TLS(urcu_qsbr_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).registered);
if ((gp_ctr = CMM_LOAD_SHARED(urcu_qsbr_gp.ctr)) == URCU_TLS(urcu_qsbr_reader).ctr)
return;
_urcu_qsbr_quiescent_state_update_and_wakeup(gp_ctr);
*/
static inline void _urcu_qsbr_thread_offline(void)
{
- urcu_assert(URCU_TLS(urcu_qsbr_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).registered);
cmm_smp_mb();
CMM_STORE_SHARED(URCU_TLS(urcu_qsbr_reader).ctr, 0);
cmm_smp_mb(); /* write URCU_TLS(urcu_qsbr_reader).ctr before read futex */
*/
static inline void _urcu_qsbr_thread_online(void)
{
- urcu_assert(URCU_TLS(urcu_qsbr_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_qsbr_reader).registered);
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
_CMM_STORE_SHARED(URCU_TLS(urcu_qsbr_reader).ctr, CMM_LOAD_SHARED(urcu_qsbr_gp.ctr));
cmm_smp_mb();
{
unsigned long tmp;
- urcu_assert(URCU_TLS(urcu_signal_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_signal_reader).registered);
cmm_barrier();
tmp = URCU_TLS(urcu_signal_reader).ctr;
- urcu_assert((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK);
+ urcu_assert_debug((tmp & URCU_GP_CTR_NEST_MASK) != URCU_GP_CTR_NEST_MASK);
_urcu_signal_read_lock_update(tmp);
}
{
unsigned long tmp;
- urcu_assert(URCU_TLS(urcu_signal_reader).registered);
+ urcu_assert_debug(URCU_TLS(urcu_signal_reader).registered);
tmp = URCU_TLS(urcu_signal_reader).ctr;
- urcu_assert(tmp & URCU_GP_CTR_NEST_MASK);
+ urcu_assert_debug(tmp & URCU_GP_CTR_NEST_MASK);
_urcu_signal_read_unlock_update_and_wakeup(tmp);
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
}