From 43fade62cebf3c70b79e48e1ad9afbb9ab6e48f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 14 Feb 2018 16:04:33 -0500 Subject: [PATCH] Document the locking assumptions of consumerd-relayd socket passing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 4 ++++ src/bin/lttng-sessiond/consumer.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 1edcffe79..ffd71bbac 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -907,6 +907,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, @@ -979,6 +981,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, diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index ced965dee..5e723e9b3 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -992,6 +992,8 @@ error: /* * Send relayd socket to consumer associated with a session name. * + * The consumer socket lock must be held by the caller. + * * On success return positive value. On error, negative value. */ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, -- 2.34.1