Fix: channel management thread should hold a refcount
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index 89b946896fc2858844be1f63c77bbd55c9e7642a..2bbc3f5e4fab1ba7b89fd0820ddf93080229b15d 100644 (file)
@@ -859,6 +859,13 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                        goto end_channel_error;
                }
 
+               /*
+                * Set refcount to 1 for owner. Below, we will pass
+                * ownership to the consumer_thread_channel_poll()
+                * thread.
+                */
+               channel->refcount = 1;
+
                /* Build channel attributes from received message. */
                attr.subbuf_size = msg.u.ask_channel.subbuf_size;
                attr.num_subbuf = msg.u.ask_channel.num_subbuf;
This page took 0.023153 seconds and 4 git commands to generate.