X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread.c;h=dd1dc3e8fe50753cfe7ac10978a6f6898df25dd3;hp=1ba724337b67ee69a1856087a5c8b65c45a32cd8;hb=8b5240601e4ddf6127e4291b7194dd5179cb35b5;hpb=b9a8d78fefbc856370939d9eb553d6e9c1fcc86a diff --git a/src/bin/lttng-sessiond/notification-thread.c b/src/bin/lttng-sessiond/notification-thread.c index 1ba724337..dd1dc3e8f 100644 --- a/src/bin/lttng-sessiond/notification-thread.c +++ b/src/bin/lttng-sessiond/notification-thread.c @@ -510,6 +510,9 @@ int init_thread_state(struct notification_thread_handle *handle, if (!state->executor) { goto error; } + + state->restart_poll = false; + mark_thread_as_ready(handle); end: return 0; @@ -656,6 +659,12 @@ void *thread_notification(void *data) goto error; } + /* + * Reset restart_poll flag so that calls below might turn it + * on. + */ + state.restart_poll = false; + fd_count = ret; for (i = 0; i < fd_count; i++) { int fd = LTTNG_POLL_GETFD(&state.events, i); @@ -733,6 +742,15 @@ void *thread_notification(void *data) } } } + + /* + * Calls above might have changed the state of the + * FDs in `state.events`. Call _poll_wait() again to + * ensure we have a consistent state. + */ + if (state.restart_poll) { + break; + } } } exit: