X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttng-consumer%2Flttng-consumer.c;h=0263aa1d83134bb5edd2937effce7d9cec1e4320;hp=617282d9c38b3690f5969f883690c7922c478b2b;hb=008dd0fe872d71d154867d25579b58a0a204d93d;hpb=6065ceec9574bf18eb79ae707f627322f2713d18 diff --git a/liblttng-consumer/lttng-consumer.c b/liblttng-consumer/lttng-consumer.c index 617282d9c..0263aa1d8 100644 --- a/liblttng-consumer/lttng-consumer.c +++ b/liblttng-consumer/lttng-consumer.c @@ -178,8 +178,7 @@ void consumer_del_stream(struct lttng_consumer_stream *stream) if (stream->wait_fd >= 0 && !stream->wait_fd_is_copy) { close(stream->wait_fd); } - if (stream->shm_fd >= 0 && stream->wait_fd != stream->shm_fd - && !stream->shm_fd_is_copy) { + if (stream->shm_fd >= 0 && stream->wait_fd != stream->shm_fd) { close(stream->shm_fd); } if (!--stream->chan->refcount) @@ -363,8 +362,7 @@ void consumer_del_channel(struct lttng_consumer_channel *channel) if (channel->wait_fd >= 0 && !channel->wait_fd_is_copy) { close(channel->wait_fd); } - if (channel->shm_fd >= 0 && channel->wait_fd != channel->shm_fd - && !channel->shm_fd_is_copy) { + if (channel->shm_fd >= 0 && channel->wait_fd != channel->shm_fd) { close(channel->shm_fd); } free(channel); @@ -845,6 +843,8 @@ void *lttng_consumer_thread_poll_fds(void *data) int tmp2; struct lttng_consumer_local_data *ctx = data; + rcu_register_thread(); + local_stream = zmalloc(sizeof(struct lttng_consumer_stream)); while (1) { @@ -1005,6 +1005,7 @@ end: free(local_stream); local_stream = NULL; } + rcu_unregister_thread(); return NULL; } @@ -1022,6 +1023,8 @@ void *lttng_consumer_thread_receive_fds(void *data) struct pollfd consumer_sockpoll[2]; struct lttng_consumer_local_data *ctx = data; + rcu_register_thread(); + DBG("Creating command socket %s", ctx->consumer_command_sock_path); unlink(ctx->consumer_command_sock_path); client_socket = lttcomm_create_unix_sock(ctx->consumer_command_sock_path); @@ -1117,6 +1120,7 @@ end: if (ret < 0) { perror("poll pipe write"); } + rcu_unregister_thread(); return NULL; }