Cleanup: Reduce scope of connections in main relayd thread
[lttng-tools.git] / src / bin / lttng-sessiond / buffer-registry.c
index 93da2f12253270c54856bc9fe303ff392141d260..0ff76defbdcce18ad8aae47b28f9b7a43951af19 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <inttypes.h>
 
 #include <common/common.h>
@@ -377,6 +378,7 @@ void buffer_reg_stream_add(struct buffer_reg_stream *stream,
 
        pthread_mutex_lock(&channel->stream_list_lock);
        cds_list_add_tail(&stream->lnode, &channel->streams);
+       channel->stream_count++;
        pthread_mutex_unlock(&channel->stream_list_lock);
 }
 
@@ -504,6 +506,7 @@ void buffer_reg_channel_destroy(struct buffer_reg_channel *regp,
                /* Wipe stream */
                cds_list_for_each_entry_safe(sreg, stmp, &regp->streams, lnode) {
                        cds_list_del(&sreg->lnode);
+                       regp->stream_count--;
                        buffer_reg_stream_destroy(sreg, domain);
                }
 
This page took 0.024754 seconds and 4 git commands to generate.