Move enablers syncing after the channel registration
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 10 Jul 2014 22:22:14 +0000 (18:22 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 14 Jul 2014 18:11:08 +0000 (14:11 -0400)
Fixes possible race condition where an event registration is received
before its channel registration by the consumer.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-events.c

index 03acff110466405976fccdb509d85077377f532b..7c5c05ed63955e89ba6c0bb104f49ae8c48c871e 100644 (file)
@@ -243,8 +243,6 @@ int lttng_session_enable(struct lttng_session *session)
 
        /* Set transient enabler state to "enabled" */
        session->tstate = 1;
-       /* We need to sync enablers with session before activation. */
-       lttng_session_sync_enablers(session);
 
        /*
         * Snapshot the number of events per channel to know the type of header
@@ -282,6 +280,9 @@ int lttng_session_enable(struct lttng_session *session)
                }
        }
 
+       /* We need to sync enablers with session before activation. */
+       lttng_session_sync_enablers(session);
+
        /* Set atomically the state to "active" */
        CMM_ACCESS_ONCE(session->active) = 1;
        CMM_ACCESS_ONCE(session->been_active) = 1;
This page took 0.025786 seconds and 4 git commands to generate.