From 69af7eef54c4e77269fc8259eca73c01241518a2 Mon Sep 17 00:00:00 2001 From: rongyichang Date: Wed, 12 Jul 2023 21:09:27 +0800 Subject: [PATCH] drivers/goldfish_pipe: notify poll event in interrupt task Signed-off-by: rongyichang --- drivers/misc/goldfish_pipe.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/misc/goldfish_pipe.c b/drivers/misc/goldfish_pipe.c index fabc76864c9..c4c802cba8d 100644 --- a/drivers/misc/goldfish_pipe.c +++ b/drivers/misc/goldfish_pipe.c @@ -659,6 +659,20 @@ static void goldfish_interrupt_task(FAR void *arg) */ nxsem_post(&pipe->wake_queue); + + if (nxmutex_lock(&dev->polllock) == OK) + { + if (wakes & PIPE_WAKE_READ) + poll_notify(dev->fds, dev->pipes_capacity, EPOLLIN); + + if (wakes & PIPE_WAKE_WRITE) + poll_notify(dev->fds, dev->pipes_capacity, EPOLLOUT); + + if (wakes & PIPE_WAKE_CLOSED) + poll_notify(dev->fds, dev->pipes_capacity, EPOLLHUP); + + nxmutex_unlock(&dev->polllock); + } } }