Signed-off-by: Emilio G. Cota <c...@braap.org>
---
 include/qemu/rcu.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h
index 83ae280..0f6e467 100644
--- a/include/qemu/rcu.h
+++ b/include/qemu/rcu.h
@@ -98,6 +98,13 @@ static inline void rcu_read_unlock(void)
     }
 }
 
+static inline bool rcu_read_lock_held(void)
+{
+    struct rcu_reader_data *p_rcu_reader = &rcu_reader;
+
+    return p_rcu_reader->depth > 0;
+}
+
 extern void synchronize_rcu(void);
 
 /*
-- 
2.5.0


Reply via email to