1 /*
2  * Copyright (c) 2006-2023, 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 #include <rtdef.h>
15 #include <rtconfig.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 struct rt_pollreq;
22 typedef void (*poll_queue_proc)(rt_wqueue_t *, struct rt_pollreq *);
23 
24 typedef struct rt_pollreq
25 {
26     poll_queue_proc _proc;
27     short _key;
28 } rt_pollreq_t;
29 
rt_poll_add(rt_wqueue_t * wq,rt_pollreq_t * req)30 rt_inline void rt_poll_add(rt_wqueue_t *wq, rt_pollreq_t *req)
31 {
32     if (req && req->_proc && wq)
33     {
34         req->_proc(wq, req);
35     }
36 }
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif
43