/* Should the ust comm thread quit ? */
static int lttng_ust_comm_should_quit;
+/*
+ * This variable can be tested by applications to check whether
+ * lttng-ust is loaded. They simply have to define their own
+ * "lttng_ust_loaded" weak symbol, and test it. It is set to 1 by the
+ * library constructor.
+ */
+int lttng_ust_loaded __attribute__((weak));
+
/*
* Return 0 on success, -1 if should quit.
* The lock is taken in both cases.
{
}
-static
-void init_ust_env(void)
-{
- if (putenv("LTTNG_UST_LOADED=1"))
- DBG("Error setting LTTNG_UST_LOADED environment variable");
-}
-
/*
* sessiond monitoring thread: monitor presence of global and per-user
* sessiond by polling the application common named pipe.
lttng_fixup_procname_tls();
lttng_fixup_ust_mutex_nest_tls();
- init_ust_env();
+ lttng_ust_loaded = 1;
/*
* We want precise control over the order in which we construct
{
cleanup_sock_info(&global_apps, exiting);
cleanup_sock_info(&local_apps, exiting);
+ local_apps.allowed = 0;
/*
* The teardown in this function all affect data structures
* accessed under the UST lock by the listener thread. This
{
if (URCU_TLS(lttng_ust_nest_count))
return;
+ lttng_context_vtid_reset();
DBG("process %d", getpid());
/* Release urcu mutexes */
rcu_bp_after_fork_child();
lttng_ust_cleanup(0);
- lttng_context_vtid_reset();
/* Release mutexes and reenable signals */
ust_after_fork_common(restore_sigset);
lttng_ust_init();