The notification command queue currently expects eventfd() to
behave according to EFD_SEMAPHORE semantics. Right now, multiple
commands could be enqueued and reading the eventfd resets its
internal counter to 0. This will cause the notification thread
to never process the next command.
EFD_SEMAPHORE will ensure that poll/epoll signals that there is
info available for reading until the eventfd's internal counter
returns to 0.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
/* FIXME Replace eventfd by a pipe to support older kernels. */
- handle->cmd_queue.event_fd = eventfd(0, EFD_CLOEXEC);
+ handle->cmd_queue.event_fd = eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE);
if (handle->cmd_queue.event_fd < 0) {
PERROR("eventfd notification command queue");
goto error;