X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.cpp;fp=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.cpp;h=70774a97530b1b625033387c2215ab052e47bf54;hp=f18bc68d44760c969b01c347500c90214c201982;hb=32670d719327feb585374283a50eeb76ce36b962;hpb=75f62e5383c6ea1f62fb488a94f4a8f98400db71 diff --git a/src/bin/lttng-sessiond/notification-thread-events.cpp b/src/bin/lttng-sessiond/notification-thread-events.cpp index f18bc68d4..70774a975 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.cpp +++ b/src/bin/lttng-sessiond/notification-thread-events.cpp @@ -3311,21 +3311,24 @@ int handle_notification_thread_command(struct notification_thread_handle *handle if (ret) { goto error_unlock; } + end: if (cmd->is_async) { - free(cmd); + delete cmd; cmd = nullptr; } else { - lttng_waiter_wake(&cmd->reply_waiter); + cmd->command_completed_waker->wake(); } + return ret; + error_unlock: /* Wake-up and return a fatal error to the calling thread. */ - lttng_waiter_wake(&cmd->reply_waiter); cmd->reply_code = LTTNG_ERR_FATAL; + error: - /* Indicate a fatal error to the caller. */ - return -1; + ret = -1; + goto end; } static int socket_set_non_blocking(int socket)