XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
cond.h
浏览该文件的文档.
1
13#ifndef __xwos_osal_sync_cond_h__
14#define __xwos_osal_sync_cond_h__
15
16#include <xwos/standard.h>
18#include <xwos/osal/time.h>
19#include <xwos/osal/sync/sel.h>
20#include <xwos/osal/lock/mtx.h>
21
91struct xwos_cond {
92 struct xwosdl_cond oscond;
93};
94
98typedef struct {
99 struct xwos_cond * cond;
102
106#define XWOS_COND_NILD ((xwos_cond_d){NULL, 0,})
107
119{
120 return xwosdl_cond_init(&cond->oscond);
121}
122
134{
135 return xwosdl_cond_fini(&cond->oscond);
136}
137
153{
154 return xwosdl_cond_grab(&cond->oscond);
155}
156
172{
173 return xwosdl_cond_put(&cond->oscond);
174}
175
187{
188 return xwosdl_cond_create((xwosdl_cond_d *)condd);
189}
190
202{
203 return xwosdl_cond_delete(&condd.cond->oscond, condd.tik);
204}
205
219{
220 return xwosdl_cond_acquire(&condd.cond->oscond, condd.tik);
221}
222
236{
237 return xwosdl_cond_release(&condd.cond->oscond, condd.tik);
238}
239
249{
250 return xwosdl_cond_get_tik(&cond->oscond);
251}
252
262{
263 xwos_cond_d condd;
264
265 condd.cond = cond;
266 condd.tik = xwosdl_cond_get_tik(&cond->oscond);
267 return condd;
268}
269
287xwer_t xwos_cond_bind(struct xwos_cond * cond, struct xwos_sel * sel, xwsq_t pos)
288{
289 return xwosdl_cond_bind(&cond->oscond, &sel->ossel, pos);
290}
291
304xwer_t xwos_cond_unbind(struct xwos_cond * cond, struct xwos_sel * sel)
305{
306 return xwosdl_cond_unbind(&cond->oscond, &sel->ossel);
307}
308
324{
325 return xwosdl_cond_freeze(&cond->oscond);
326}
327
343{
344 return xwosdl_cond_thaw(&cond->oscond);
345}
346
363{
364 return xwosdl_cond_broadcast(&cond->oscond);
365}
366
383{
384 return xwosdl_cond_unicast(&cond->oscond);
385}
386
433 union xwos_ulock lock, xwsq_t lktype, void * lkdata,
434 xwsq_t * lkst)
435{
436 return xwosdl_cond_wait(&cond->oscond, lock, lktype, lkdata, lkst);
437}
438
493 union xwos_ulock lock, xwsq_t lktype, void * lkdata,
494 xwtm_t to, xwsq_t * lkst)
495{
496 return xwosdl_cond_wait_to(&cond->oscond, lock, lktype, lkdata, to, lkst);
497}
498
544 union xwos_ulock lock, xwsq_t lktype, void * lkdata,
545 xwsq_t * lkst)
546{
547 return xwosdl_cond_wait_unintr(&cond->oscond, lock, lktype, lkdata, lkst);
548}
549
554#endif /* xwos/osal/sync/cond.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 xwsq_t
Definition type.h:445
static xwer_t xwos_cond_init(struct xwos_cond *cond)
XWOS API:静态方式初始化条件量对象
Definition cond.h:118
static xwer_t xwos_cond_acquire(xwos_cond_d condd)
XWOS API:检查条件量对象的标签并增加引用计数
Definition cond.h:218
static xwer_t xwos_cond_wait_unintr(struct xwos_cond *cond, union xwos_ulock lock, xwsq_t lktype, void *lkdata, xwsq_t *lkst)
XWOS API:不可中断地等待条件量
Definition cond.h:543
static xwer_t xwos_cond_fini(struct xwos_cond *cond)
XWOS API:销毁静态方式初始化的条件量对象
Definition cond.h:133
static xwsq_t xwos_cond_get_tik(struct xwos_cond *cond)
XWOS API:获取条件量对象的标签
Definition cond.h:248
static xwer_t xwos_cond_wait(struct xwos_cond *cond, union xwos_ulock lock, xwsq_t lktype, void *lkdata, xwsq_t *lkst)
XWOS API:等待条件量
Definition cond.h:432
static xwer_t xwos_cond_delete(xwos_cond_d condd)
XWOS API:删除动态方式创建的条件量对象
Definition cond.h:201
static xwer_t xwos_cond_broadcast(struct xwos_cond *cond)
XWOS API:广播条件量对象
Definition cond.h:362
static xwer_t xwos_cond_create(xwos_cond_d *condd)
XWOS API:动态方式创建条件量对象
Definition cond.h:186
static xwer_t xwos_cond_grab(struct xwos_cond *cond)
XWOS API:增加条件量对象的引用计数
Definition cond.h:152
static xwer_t xwos_cond_thaw(struct xwos_cond *cond)
XWOS API:解冻条件量对象
Definition cond.h:342
static xwer_t xwos_cond_release(xwos_cond_d condd)
XWOS API:检查对象的标签并减少引用计数
Definition cond.h:235
static xwer_t xwos_cond_wait_to(struct xwos_cond *cond, union xwos_ulock lock, xwsq_t lktype, void *lkdata, xwtm_t to, xwsq_t *lkst)
XWOS API:限时等待条件量
Definition cond.h:492
static xwer_t xwos_cond_bind(struct xwos_cond *cond, struct xwos_sel *sel, xwsq_t pos)
XWOS API:绑定条件量对象到信号选择器
Definition cond.h:287
static xwer_t xwos_cond_freeze(struct xwos_cond *cond)
XWOS API:冻结条件量对象
Definition cond.h:323
static xwer_t xwos_cond_put(struct xwos_cond *cond)
XWOS API:减少条件量对象的引用计数
Definition cond.h:171
static xwos_cond_d xwos_cond_get_d(struct xwos_cond *cond)
XWOS API:获取条件量对象描述符
Definition cond.h:261
static xwer_t xwos_cond_unbind(struct xwos_cond *cond, struct xwos_sel *sel)
XWOS API:从信号选择器上解绑条件量对象
Definition cond.h:304
static xwer_t xwos_cond_unicast(struct xwos_cond *cond)
XWOS API:单播条件量对象
Definition cond.h:382
操作系统抽象层:条件量接口描述
操作系统抽象层:互斥锁
XWOS API:条件量对象描述符
Definition cond.h:98
xwsq_t tik
Definition cond.h:100
struct xwos_cond * cond
Definition cond.h:99
XWOS API:条件量对象
Definition cond.h:91
struct xwmp_cond oscond
Definition cond.h:92
XWOS API:信号选择器对象
Definition sel.h:81
struct xwmp_evt ossel
Definition sel.h:82
操作系统抽象层:信号选择器
操作系统抽象层:时间
所有锁的联合
Definition type.h:680
XWOS的标准头文件