X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-comm.c;h=099a6c85f1959ddc98e1cde72059f64d5cecaa42;hb=9501d22f55b3a23f382f631c99b2325d1419b5da;hp=36f57efb25f4d97c31bcb04b7fd207f2807b9a8c;hpb=03c261a4a68e20cdcc68dc96531225c75a289235;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 36f57efb..099a6c85 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -46,6 +46,7 @@ #include "tracepoint-internal.h" #include "ltt-tracer-core.h" #include "compat.h" +#include "../libringbuffer/tlsfixup.h" /* * Has lttng ust comm constructor been called ? @@ -390,7 +391,7 @@ void cleanup_sock_info(struct sock_info *sock_info, int exiting) int ret; if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing apps socket"); } @@ -670,7 +671,7 @@ restart: } if (sock_info->socket != -1) { - ret = close(sock_info->socket); + ret = ustcomm_close_unix_sock(sock_info->socket); if (ret) { ERR("Error closing %s apps socket", sock_info->name); } @@ -827,6 +828,15 @@ void __attribute__((constructor)) lttng_ust_init(void) if (uatomic_xchg(&initialized, 1) == 1) return; + /* + * Fixup interdependency between TLS fixup mutex (which happens + * to be the dynamic linker mutex) and ust_lock, taken within + * the ust lock. + */ + lttng_fixup_event_tls(); + lttng_fixup_ringbuffer_tls(); + lttng_fixup_vtid_tls(); + /* * We want precise control over the order in which we construct * our sub-libraries vs starting to receive commands from