X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng%2Fnotification%2Fchannel.h;h=7708cfd56e915a293007d481f0f36c1dd8980454;hp=b010df12aa56b8194241fd17af947a0c8e2e1009;hb=1d757b1cd3b4669b52e2d9ceafb03eafd42490ff;hpb=94a61469bd430d5906b5c976379dd16e32d73933 diff --git a/include/lttng/notification/channel.h b/include/lttng/notification/channel.h index b010df12a..7708cfd56 100644 --- a/include/lttng/notification/channel.h +++ b/include/lttng/notification/channel.h @@ -18,6 +18,8 @@ #ifndef LTTNG_NOTIFICATION_CHANNEL_H #define LTTNG_NOTIFICATION_CHANNEL_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -89,6 +91,26 @@ lttng_notification_channel_get_next_notification( struct lttng_notification_channel *channel, struct lttng_notification **notification); +/* + * Check whether a notification is pending on a notification channel. + * + * This call allows the user to check whether a notification is pending on + * the notification channel. + * + * If pending is set to true and the return value is + * LTTNG_NOTIFICATION_CHANNEL_STATUS_OK, + * lttng_notification_channel_get_next_notification() can be called and + * is guaranteed to not block. + * + * Returns LTTNG_NOTIFICATION_CHANNEL_STATUS_OK on success or + * LTTNG_NOTIFICATION_CHANNEL_STATUS_INVALID if an invalid parameter was + * provided. + */ +extern enum lttng_notification_channel_status +lttng_notification_channel_has_pending_notification( + struct lttng_notification_channel *channel, + bool *notification_pending); + /* * Subscribe to notifications of a condition through a notification channel. *