* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <common/common.h>
#include <urcu/rculist.h>
struct relay_session *session =
caa_container_of(rcu_head, struct relay_session,
rcu_node);
-
+ /*
+ * Since each trace has a reference on the session, it means
+ * that if we are at the point where we teardown the session, no
+ * trace belonging to that session exist at this point.
+ * Calling lttng_ht_destroy in call_rcu worker thread so we
+ * don't hold the RCU read-side lock while calling it.
+ */
+ lttng_ht_destroy(session->ctf_traces_ht);
free(session);
}
ret = session_delete(session);
assert(!ret);
- /*
- * Since each trace has a reference on the session, it means
- * that if we are at the point where we teardown the session, no
- * trace belonging to that session exist at this point.
- */
- lttng_ht_destroy(session->ctf_traces_ht);
call_rcu(&session->rcu_node, rcu_destroy_session);
}
}
cds_list_for_each_entry_rcu(stream, &session->recv_list,
recv_node) {
- stream_close(stream);
+ /* Close streams which have not been published yet. */
+ try_stream_close(stream);
}
rcu_unlock:
rcu_read_unlock();