X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fhealth-internal.hpp;fp=include%2Flttng%2Fhealth-internal.hpp;h=eee164cb141d4b86ed009d52d31c8ccfa9f5508e;hp=a3bf001ce757879c8eb728286c1961b720da18a5;hb=9fd09ab6c005d062ce436ad54738e83313f65af2;hpb=5b9eda8a30a21a1c9de4572dd2b397c7cf923fa1 diff --git a/include/lttng/health-internal.hpp b/include/lttng/health-internal.hpp index a3bf001ce..eee164cb1 100644 --- a/include/lttng/health-internal.hpp +++ b/include/lttng/health-internal.hpp @@ -65,7 +65,7 @@ struct health_comm_reply { } LTTNG_PACKED; /* Declare TLS health state. */ -extern DECLARE_URCU_TLS(struct health_state, health_state); +extern thread_local struct health_state health_state; /* * Update current counter by 1 to indicate that the thread entered or left a @@ -75,9 +75,9 @@ extern DECLARE_URCU_TLS(struct health_state, health_state); static inline void health_poll_entry() { /* Code MUST be in code execution state which is an even number. */ - LTTNG_ASSERT(!(uatomic_read(&URCU_TLS(health_state).current) & HEALTH_POLL_VALUE)); + LTTNG_ASSERT(!(uatomic_read(&health_state.current) & HEALTH_POLL_VALUE)); - uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE); + uatomic_add(&health_state.current, HEALTH_POLL_VALUE); } /* @@ -88,9 +88,9 @@ static inline void health_poll_entry() static inline void health_poll_exit() { /* Code MUST be in poll execution state which is an odd number. */ - LTTNG_ASSERT(uatomic_read(&URCU_TLS(health_state).current) & HEALTH_POLL_VALUE); + LTTNG_ASSERT(uatomic_read(&health_state.current) & HEALTH_POLL_VALUE); - uatomic_add(&URCU_TLS(health_state).current, HEALTH_POLL_VALUE); + uatomic_add(&health_state.current, HEALTH_POLL_VALUE); } /* @@ -99,7 +99,7 @@ static inline void health_poll_exit() */ static inline void health_code_update() { - uatomic_add(&URCU_TLS(health_state).current, HEALTH_CODE_VALUE); + uatomic_add(&health_state.current, HEALTH_CODE_VALUE); } /* @@ -107,7 +107,7 @@ static inline void health_code_update() */ static inline void health_error() { - uatomic_or(&URCU_TLS(health_state).flags, HEALTH_ERROR); + uatomic_or(&health_state.flags, HEALTH_ERROR); } struct health_app *health_app_create(int nr_types);