goto error;
}
+ /* Perform prior memory accesses before decrementing ready */
+ cmm_smp_mb__before_uatomic_dec();
+ uatomic_dec(<tng_consumer_ready);
+
while (1) {
DBG("Health check ready");
const char *tracing_group_name = DEFAULT_TRACING_GROUP;
+int lttng_consumer_ready = NR_LTTNG_CONSUMER_READY;
+
enum lttng_consumer_type lttng_consumer_get_type(void)
{
if (!ctx) {
goto health_error;
}
+ /*
+ * Wait for health thread to be initialized before letting the
+ * sessiond thread reply to the sessiond that we are ready.
+ */
+ while (uatomic_read(<tng_consumer_ready)) {
+ sleep(1);
+ }
+ cmm_smp_mb(); /* Read ready before following operations */
+
/* Create thread to manage channels */
ret = pthread_create(&channel_thread, NULL, consumer_thread_channel_poll,
(void *) ctx);
#ifndef _LTTNG_CONSUMERD_H
#define _LTTNG_CONSUMERD_H
+
+#define NR_LTTNG_CONSUMER_READY 1
+extern int lttng_consumer_ready;
+
const char *tracing_group_name;
enum lttng_consumer_type lttng_consumer_get_type(void);