X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=731040a3c6c9e157ec2fe9f9b91268ae4fdbccf6;hb=32a57e73c32665293649226ccbc8af025792f35e;hp=ffaf999ab25658954f8ffb9d6ef1958c869b2e6e;hpb=aecac544b3bb511042c76c0e460c35dd765816e6;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index ffaf999ab..731040a3c 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -886,6 +886,8 @@ error: /* * Connect to the relayd using URI and send the socket to the right consumer. + * + * The consumer socket lock must be held by the caller. */ static int send_consumer_relayd_socket(enum lttng_domain_type domain, unsigned int session_id, struct lttng_uri *relayd_uri, @@ -958,6 +960,8 @@ relayd_comm_error: * Send both relayd sockets to a specific consumer and domain. This is a * helper function to facilitate sending the information to the consumer for a * session. + * + * The consumer socket lock must be held by the caller. */ static int send_consumer_relayd_sockets(enum lttng_domain_type domain, unsigned int session_id, struct consumer_output *consumer, @@ -3606,10 +3610,12 @@ static int set_relayd_for_snapshot(struct consumer_output *consumer, rcu_read_lock(); cds_lfht_for_each_entry(snap_output->consumer->socks->ht, &iter.iter, socket, node.node) { + pthread_mutex_lock(socket->lock); ret = send_consumer_relayd_sockets(0, session->id, snap_output->consumer, socket, session->name, session->hostname, session->live_timer); + pthread_mutex_unlock(socket->lock); if (ret != LTTNG_OK) { rcu_read_unlock(); goto error;