*/
#define _GNU_SOURCE
+/*
+ * Do _not_ define _LGPL_SOURCE because we don't want to create a
+ * circular dependency loop between this malloc wrapper, liburcu and
+ * libc.
+ */
#include <lttng/ust-dlfcn.h>
+#include <urcu/tls-compat.h>
#include <helper.h>
#include <pthread.h>
#define TP_IP_PARAM ip
#include "ust_pthread.h"
-static __thread int thread_in_trace;
+static DEFINE_URCU_TLS_IE(int, thread_in_trace);
int pthread_mutex_lock(pthread_mutex_t *mutex)
{