- for (i = 0; i < 2; i++) {
- ret = pthread_join(threads[i], &status);
+ /* Create thread to manage the polling/writing of trace data */
+ ret = pthread_create(&data_thread, NULL, consumer_thread_data_poll,
+ (void *) ctx);
+ if (ret != 0) {
+ perror("pthread_create");
+ goto data_error;
+ }
+
+ /* Create the thread to manage the receive of fd */
+ ret = pthread_create(&sessiond_thread, NULL, consumer_thread_sessiond_poll,
+ (void *) ctx);
+ if (ret != 0) {
+ perror("pthread_create");
+ goto sessiond_error;
+ }
+
+ switch (opt_type) {
+ case LTTNG_CONSUMER32_UST:
+ case LTTNG_CONSUMER64_UST:
+ /* Create the thread to manage the metadata periodic timers */
+ ret = pthread_create(&metadata_timer_thread, NULL,
+ consumer_timer_metadata_thread, (void *) ctx);