Fix missing session locks
authorDavid Goulet <dgoulet@efficios.com>
Tue, 14 Feb 2012 20:35:31 +0000 (15:35 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 14 Feb 2012 20:35:31 +0000 (15:35 -0500)
When an application registers, an update is triggered to create pending
events of the global event registry. This process MUST held the session
lock and the session list locks since it's iterating over all sessions.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/main.c

index 8e794bdf4365be1779c2f0bb94c5e99dae5b03ee..6c4b8ec5ce4c94a26b14c33f44839938f8bdd7ac 100644 (file)
@@ -769,12 +769,18 @@ static void update_ust_app(int app_sock)
 {
        struct ltt_session *sess, *stmp;
 
+       session_lock_list();
+
        /* For all tracing session(s) */
        cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) {
+               session_lock(sess);
                if (sess->ust_session) {
                        ust_app_global_update(sess->ust_session, app_sock);
                }
+               session_unlock(sess);
        }
+
+       session_unlock_list();
 }
 
 /*
This page took 0.028363 seconds and 5 git commands to generate.