All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-ust] Move enablers syncing after the channel registration
@ 2014-07-10 22:22 francis.deslauriers
  0 siblings, 0 replies; only message in thread
From: francis.deslauriers @ 2014-07-10 22:22 UTC (permalink / raw)
  To: lttng-dev

From: Francis Deslauriers <francis.deslauriers@efficios.com>

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>
---
 liblttng-ust/lttng-events.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c
index e44628d..285b98e 100644
--- a/liblttng-ust/lttng-events.c
+++ b/liblttng-ust/lttng-events.c
@@ -248,8 +248,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
@@ -287,6 +285,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;
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-10 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-10 22:22 [PATCH lttng-ust] Move enablers syncing after the channel registration francis.deslauriers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.