drivers/goldfish_pipe: notify poll event in interrupt task

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
This commit is contained in:
rongyichang 2023-07-12 21:09:27 +08:00 committed by Xiang Xiao
parent 3fd404a4c5
commit 69af7eef54

View File

@ -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);
}
}
}