rcu_read_lock();
session = session_find_by_id(ksession->id);
LTTNG_ASSERT(session);
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
status = notification_thread_command_add_channel(
the_notification_thread_handle, session->name,
#include "trace-kernel.hpp"
#include "consumer.hpp"
+#define ASSERT_SESSION_LIST_LOCKED() LTTNG_ASSERT(session_trylock_list())
+
struct ltt_ust_session;
typedef void (*ltt_session_destroy_notifier)(const struct ltt_session *session,
session = session_find_by_id(ua_sess->tracing_id);
LTTNG_ASSERT(session);
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
/*
* Create the buffers on the consumer side. This call populates the
session = session_find_by_id(ua_sess->tracing_id);
LTTNG_ASSERT(session);
-
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
/* Create and get channel on the consumer side. */
ret = do_consumer_create_channel(usess, ua_sess, ua_chan,
session = session_find_by_id(ua_sess->tracing_id);
LTTNG_ASSERT(session);
-
- LTTNG_ASSERT(pthread_mutex_trylock(&session->lock));
- LTTNG_ASSERT(session_trylock_list());
+ ASSERT_LOCKED(session->lock);
+ ASSERT_SESSION_LIST_LOCKED();
/*
* Ask the metadata channel creation to the consumer. The metadata object