xref: /nrf52832-nimble/rt-thread/components/drivers/include/ipc/poll.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2  * Copyright (c) 2006-2018, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2016-09-19     Heyuanjie    The first version.
9  * 2016-12-26     Bernard      Update poll interface
10  */
11 #ifndef IPC_POLL_H__
12 #define IPC_POLL_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 struct rt_pollreq;
19 typedef void (*poll_queue_proc)(rt_wqueue_t *, struct rt_pollreq *);
20 
21 typedef struct rt_pollreq
22 {
23     poll_queue_proc _proc;
24     short _key;
25 } rt_pollreq_t;
26 
rt_poll_add(rt_wqueue_t * wq,rt_pollreq_t * req)27 rt_inline void rt_poll_add(rt_wqueue_t *wq, rt_pollreq_t *req)
28 {
29     if (req && req->_proc && wq)
30     {
31         req->_proc(wq, req);
32     }
33 }
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif
40