Signed-off-by: Lai Jiangshan <[email protected]>
---
urcu/tls-compat.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/urcu/tls-compat.h b/urcu/tls-compat.h
index 192a536..b7bf363 100644
--- a/urcu/tls-compat.h
+++ b/urcu/tls-compat.h
@@ -59,6 +59,20 @@ extern "C" {
#else /* #ifndef CONFIG_RCU_TLS */
+/*
+ * NOTE: URCU_TLS() is NOT async-signal-safe, you can't use it
+ * inside any function which can be called from signal handler.
+ *
+ * But if pthread_getspecific() is async-signal-safe in your
+ * platform, you can make URCU_TLS() async-signal-safe via:
+ * ensuring the first call to URCU_TLS() of a given TLS variable of
+ * all threads is called earliest from a non-signal handler function.
+ *
+ * Exmaple: In any thread, the first call of URCU_TLS(rcu_reader)
+ * is called from rcu_register_thread(), so we can ensure all later
+ * URCU_TLS(rcu_reader) in any thread is async-signal-safe.
+ */
+
# include <pthread.h>
struct urcu_tls {
--
1.7.4.4
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev