Document the locking assumptions of consumerd-relayd socket passing
[lttng-tools.git] / src / bin / lttng-sessiond / consumer.c
index 8290b5faf05944fdae379a6b812f0a622020903e..7c8f4e83093590e61ac4d4e565d8d0bc9ba7b5f1 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) {
@@ -986,6 +987,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.02476 seconds and 4 git commands to generate.