#include <lttng/domain.h>
#include <lttng/lttng-error.h>
+#include <vendor/optional.hpp>
+
#include <stdbool.h>
#include <urcu/rculfhash.h>
};
struct notification_thread_command {
- struct cds_list_head cmd_list_node;
+ struct cds_list_head cmd_list_node = {};
- enum notification_thread_command_type type;
+ notification_thread_command_type type = NOTIFICATION_COMMAND_TYPE_QUIT;
union {
/* Register trigger. */
struct {
const struct lttng_trigger *trigger;
} get_trigger;
- } parameters;
+ } parameters = {};
union {
struct {
struct {
struct lttng_trigger *trigger;
} get_trigger;
- } reply;
- /* lttng_waiter on which to wait for command reply (optional). */
- struct lttng_waiter reply_waiter;
- enum lttng_error_code reply_code;
- bool is_async;
+ } reply = {};
+
+ /* Used to wake origin thread for synchroneous commands. */
+ nonstd::optional<lttng::synchro::waker> command_completed_waker = nonstd::nullopt;
+ lttng_error_code reply_code = LTTNG_ERR_UNK;
+ bool is_async = false;
};
enum lttng_error_code