+LTTNG_HIDDEN
+void logger_set_thread_name(const char *name, bool set_pthread_name)
+{
+ int ret;
+
+ assert(name);
+ URCU_TLS(logger_thread_name) = name;
+
+ if (set_pthread_name) {
+ ret = lttng_thread_setname(name);
+ if (ret && ret != -ENOSYS) {
+ /* Don't fail as this is not essential. */
+ DBG("Failed to set pthread name attribute");
+ }
+ }
+}
+