X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng-relayd%2Fsession.c;h=f76fb4a42e7606b8ebfea427033b00e3de192020;hb=98ba050ed140ff29ac98f66dba0e47db70e4a0c5;hp=9702bd220b0d134bc4502ecd6e4435e682e22ba1;hpb=5feafd413038626a47de89c0b29e41673b68818a;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/session.c b/src/bin/lttng-relayd/session.c index 9702bd220..f76fb4a42 100644 --- a/src/bin/lttng-relayd/session.c +++ b/src/bin/lttng-relayd/session.c @@ -228,6 +228,27 @@ rcu_unlock: return ret; } +int session_abort(struct relay_session *session) +{ + int ret = 0; + + if (!session) { + return 0; + } + + pthread_mutex_lock(&session->lock); + DBG("aborting session %" PRIu64, session->id); + if (session->aborted) { + ERR("session %" PRIu64 " is already aborted", session->id); + ret = -1; + goto unlock; + } + session->aborted = true; +unlock: + pthread_mutex_unlock(&session->lock); + return ret; +} + void print_sessions(void) { struct lttng_ht_iter iter;