poll: add poll_notify() api and call it in all drivers

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
wangbowen6
2022-09-19 11:08:57 +08:00
committed by Xiang Xiao
parent 74842880f9
commit 344c8be049
83 changed files with 289 additions and 1441 deletions
+7 -22
View File
@@ -79,6 +79,13 @@
# define _MQ_TIMEDRECEIVE(d,m,l,p,t) mq_timedreceive(d,m,l,p,t)
#endif
#if CONFIG_FS_MQUEUE_NPOLLWAITERS > 0
# define nxmq_pollnotify(msgq, eventset) \
poll_notify(msgq->fds, CONFIG_FS_MQUEUE_NPOLLWAITERS, eventset)
#else
# define nxmq_pollnotify(msgq, eventset)
#endif
/****************************************************************************
* Public Type Declarations
****************************************************************************/
@@ -404,28 +411,6 @@ void nxmq_free_msgq(FAR struct mqueue_inode_s *msgq);
int nxmq_alloc_msgq(FAR struct mq_attr *attr,
FAR struct mqueue_inode_s **pmsgq);
/****************************************************************************
* Name: nxmq_pollnotify
*
* Description:
* pollnotify, used for notifying the poll
*
* Input Parameters:
* msgq - Named message queue
* eventset - evnet
*
* Returned Value:
* The allocated and initialized message queue structure or NULL in the
* event of a failure.
*
****************************************************************************/
#if CONFIG_FS_MQUEUE_NPOLLWAITERS > 0
void nxmq_pollnotify(FAR struct mqueue_inode_s *msgq, pollevent_t eventset);
#else
# define nxmq_pollnotify(msgq, eventset)
#endif
/****************************************************************************
* Name: file_mq_open
*
+2
View File
@@ -144,6 +144,8 @@ int ppoll(FAR struct pollfd *fds, nfds_t nfds,
FAR const struct timespec *timeout_ts,
FAR const sigset_t *sigmask);
void poll_notify(FAR struct pollfd **afds, int nfds, pollevent_t eventset);
#undef EXTERN
#if defined(__cplusplus)
}