X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fstatic%2Furcu.h;fp=urcu%2Fstatic%2Furcu.h;h=6c8b92602234b97d27a4cb462ec0ec06c56a62c7;hp=973826a52bfa021423bbb8cce12545357d2df48b;hb=882f335739b978d1c55be2faeed077f315afe5d7;hpb=171ff3a34ac166a41a075749517fd3780df121da diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h index 973826a..6c8b926 100644 --- a/urcu/static/urcu.h +++ b/urcu/static/urcu.h @@ -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