mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
+7
-22
@@ -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
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user