Document the locking assumptions of consumerd-relayd socket passing
[lttng-tools.git] / src / bin / lttng-sessiond / consumer.c
index bd9048bf517d54b9ccb8148310d82b5ee21bc9b1..5e723e9b3804e08335d3e16758486899ec79f83e 100644 (file)
@@ -739,6 +739,7 @@ int consumer_send_fds(struct consumer_socket *sock, int *fds, size_t nb_fd)
        assert(fds);
        assert(sock);
        assert(nb_fd > 0);
+       assert(pthread_mutex_trylock(sock->lock) == EBUSY);
 
        ret = lttcomm_send_fds_unix_sock(*sock->fd_ptr, fds, nb_fd);
        if (ret < 0) {
@@ -991,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,
This page took 0.026793 seconds and 5 git commands to generate.