+ /*
+ * For UST consumer, we block RT signals used for periodical metadata flush
+ * in main and create a dedicated thread to handle these signals.
+ */
+ switch (opt_type) {
+ case LTTNG_CONSUMER32_UST:
+ case LTTNG_CONSUMER64_UST:
+ consumer_signal_init();
+ break;
+ default:
+ break;
+ }
+ ctx->type = opt_type;
+
+ /* Initialize communication library */
+ lttcomm_init();
+
+ /* Create thread to manage channels */
+ ret = pthread_create(&channel_thread, NULL, consumer_thread_channel_poll,
+ (void *) ctx);
+ if (ret != 0) {
+ perror("pthread_create");
+ goto error;
+ }
+