XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
sel.h
浏览该文件的文档.
1
13#ifndef __xwos_osal_sync_sel_h__
14#define __xwos_osal_sync_sel_h__
15
16#include <xwos/standard.h>
18#include <xwos/osal/time.h>
19
81struct xwos_sel {
82 struct xwosdl_sel ossel;
83};
84
88typedef struct {
89 struct xwos_sel * sel;
92
96#define XWOS_SEL_NILD ((xwos_sel_d){NULL, 0,})
97
112 xwbmp_t * bmp, xwbmp_t * msk)
113{
114 return xwosdl_sel_init(&sel->ossel, num, bmp, msk);
115}
116
128{
129 return xwosdl_sel_fini(&sel->ossel);
130}
131
147{
148 return xwosdl_sel_grab(&sel->ossel);
149}
150
166{
167 return xwosdl_sel_put(&sel->ossel);
168}
169
183{
184 return xwosdl_sel_create((xwosdl_sel_d *)seld, num);
185}
186
198{
199 return xwosdl_sel_delete(&seld.sel->ossel, seld.tik);
200}
201
215{
216 return xwosdl_sel_acquire(&seld.sel->ossel, seld.tik);
217}
218
232{
233 return xwosdl_sel_release(&seld.sel->ossel, seld.tik);
234}
235
245{
246 return xwosdl_sel_get_tik(&sel->ossel);
247}
248
258{
259 xwos_sel_d seld;
260
261 seld.sel = sel;
262 seld.tik = xwosdl_sel_get_tik(&sel->ossel);
263 return seld;
264}
265
284xwer_t xwos_sel_bind(struct xwos_sel * src, struct xwos_sel * dst, xwsq_t pos)
285{
286 return xwosdl_sel_bind(&src->ossel, &dst->ossel, pos);
287}
288
301xwer_t xwos_sel_unbind(struct xwos_sel * src, struct xwos_sel * dst)
302{
303 return xwosdl_sel_unbind(&src->ossel, &dst->ossel);
304}
305
317xwer_t xwos_sel_get_num(struct xwos_sel * sel, xwsz_t * numbuf)
318{
319 return xwosdl_sel_get_num(&sel->ossel, numbuf);
320}
321
336xwer_t xwos_sel_select(struct xwos_sel * sel, xwbmp_t msk[], xwbmp_t trg[])
337{
338 return xwosdl_sel_select(&sel->ossel, msk, trg);
339}
340
363 xwbmp_t msk[], xwbmp_t trg[],
364 xwtm_t to)
365{
366 return xwosdl_sel_select_to(&sel->ossel, msk, trg, to);
367}
368
385{
386 return xwosdl_sel_select(&sel->ossel, msk, trg);
387}
388
393#endif /* xwos/osal/sync/sel.h */
#define __xwos_inline_api
Definition compiler.h:179
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
unsigned long xwsz_t
Definition type.h:339
unsigned long xwsq_t
Definition type.h:445
xwu32_t xwbmp_t
Definition type.h:574
static xwer_t xwos_sel_select_to(struct xwos_sel *sel, xwbmp_t msk[], xwbmp_t trg[], xwtm_t to)
XWOS API:限时等待信号选择器中的 选择信号
Definition sel.h:362
static xwer_t xwos_sel_fini(struct xwos_sel *sel)
XWOS API:销毁静态方式初始化的信号选择器
Definition sel.h:127
static xwer_t xwos_sel_get_num(struct xwos_sel *sel, xwsz_t *numbuf)
XWOS API:获取信号选择器中的信号槽的数量
Definition sel.h:317
static xwer_t xwos_sel_grab(struct xwos_sel *sel)
XWOS API:增加信号选择器对象的引用计数
Definition sel.h:146
static xwer_t xwos_sel_create(xwos_sel_d *seld, xwsz_t num)
XWOS API:动态方式创建信号选择器
Definition sel.h:182
static xwer_t xwos_sel_bind(struct xwos_sel *src, struct xwos_sel *dst, xwsq_t pos)
XWOS API:绑定源信号选择器到目的信号选择器
Definition sel.h:284
static xwer_t xwos_sel_unbind(struct xwos_sel *src, struct xwos_sel *dst)
XWOS API:从目的信号选择器上解绑源信号选择器
Definition sel.h:301
static xwsq_t xwos_sel_get_tik(struct xwos_sel *sel)
XWOS API:获取信号选择器对象的标签
Definition sel.h:244
static xwer_t xwos_sel_delete(xwos_sel_d seld)
XWOS API:删除动态方式创建的信号选择器
Definition sel.h:197
static xwer_t xwos_sel_acquire(xwos_sel_d seld)
XWOS API:检查信号选择器对象的标签并增加引用计数
Definition sel.h:214
static xwer_t xwos_sel_release(xwos_sel_d seld)
XWOS API:检查对象的标签并减少引用计数
Definition sel.h:231
static xwer_t xwos_sel_tryselect(struct xwos_sel *sel, xwbmp_t msk[], xwbmp_t trg[])
XWOS API:检测信号选择器中是否有 选择信号
Definition sel.h:384
static xwer_t xwos_sel_init(struct xwos_sel *sel, xwsz_t num, xwbmp_t *bmp, xwbmp_t *msk)
XWOS API:静态方式初始化信号选择器
Definition sel.h:111
static xwer_t xwos_sel_select(struct xwos_sel *sel, xwbmp_t msk[], xwbmp_t trg[])
XWOS API:等待信号选择器中的 选择信号
Definition sel.h:336
static xwos_sel_d xwos_sel_get_d(struct xwos_sel *sel)
XWOS API:获取信号选择器对象描述符
Definition sel.h:257
static xwer_t xwos_sel_put(struct xwos_sel *sel)
XWOS API:减少信号选择器对象的引用计数
Definition sel.h:165
操作系统抽象层:信号选择器接口描述
XWOS API:信号选择器对象描述符
Definition sel.h:88
struct xwos_sel * sel
Definition sel.h:89
xwsq_t tik
Definition sel.h:90
XWOS API:信号选择器对象
Definition sel.h:81
struct xwmp_evt ossel
Definition sel.h:82
操作系统抽象层:时间
XWOS的标准头文件