Add rcu_read_ongoing() API to each urcu flavor
[urcu.git] / urcu / static / urcu.h
index 973826a52bfa021423bbb8cce12545357d2df48b..6c8b92602234b97d27a4cb462ec0ec06c56a62c7 100644 (file)
@@ -329,6 +329,18 @@ static inline void _rcu_read_unlock(void)
        cmm_barrier();  /* Ensure the compiler does not reorder us with mutex */
 }
 
+/*
+ * Returns whether within a RCU read-side critical section.
+ *
+ * This function is less than 10 lines long.  The intent is that this
+ * function meets the 10-line criterion for LGPL, allowing this function
+ * to be invoked directly from non-LGPL code.
+ */
+static inline int _rcu_read_ongoing(void)
+{
+       return URCU_TLS(rcu_reader).ctr & RCU_GP_CTR_NEST_MASK;
+}
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.022451 seconds and 4 git commands to generate.