XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
br.h
浏览该文件的文档.
1
13#ifndef __xwos_osal_sync_br_h__
14#define __xwos_osal_sync_br_h__
15
16#include <xwos/standard.h>
18#include <xwos/osal/time.h>
19#include <xwos/osal/sync/sel.h>
20
81struct xwos_br {
82 struct xwosdl_br osbr;
83};
84
88typedef struct {
89 struct xwos_br * br;
91} xwos_br_d;
92
96#define XWOS_BR_NILD ((xwos_br_d){NULL, 0,})
97
112 xwbmp_t * bmp, xwbmp_t * msk)
113{
114 return xwosdl_br_init(&br->osbr, num, bmp, msk);
115}
116
128{
129 return xwosdl_br_fini(&br->osbr);
130}
131
147{
148 return xwosdl_br_grab(&br->osbr);
149}
150
166{
167 return xwosdl_br_put(&br->osbr);
168}
169
183{
184 return xwosdl_br_create((xwosdl_br_d *)brd, num);
185}
186
198{
199 return xwosdl_br_delete(&brd.br->osbr, brd.tik);
200}
201
215{
216 return xwosdl_br_acquire(&brd.br->osbr, brd.tik);
217}
218
232{
233 return xwosdl_br_release(&brd.br->osbr, brd.tik);
234}
235
245{
246 return xwosdl_br_get_tik(&br->osbr);
247}
248
258{
259 xwos_br_d brd;
260
261 brd.br = br;
262 brd.tik = xwosdl_br_get_tik(&br->osbr);
263 return brd;
264}
265
284xwer_t xwos_br_bind(struct xwos_br * br, struct xwos_sel * sel, xwsq_t pos)
285{
286 return xwosdl_br_bind(&br->osbr, &sel->ossel, pos);
287}
288
301xwer_t xwos_br_unbind(struct xwos_br * br, struct xwos_sel * sel)
302{
303 return xwosdl_br_unbind(&br->osbr, &sel->ossel);
304}
305
317xwer_t xwos_br_get_num(struct xwos_br * br, xwsz_t * numbuf)
318{
319 return xwosdl_br_get_num(&br->osbr, numbuf);
320}
321
336{
337 return xwosdl_br_wait(&br->osbr);
338}
339
361{
362 return xwosdl_br_wait_to(&br->osbr, to);
363}
364
369#endif /* xwos/osal/sync/br.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_br_create(xwos_br_d *brd, xwsz_t num)
XWOS API:动态方式创建线程栅栏
Definition br.h:182
static xwer_t xwos_br_delete(xwos_br_d brd)
XWOS API:删除动态方式创建的线程栅栏
Definition br.h:197
static xwer_t xwos_br_init(struct xwos_br *br, xwsz_t num, xwbmp_t *bmp, xwbmp_t *msk)
XWOS API:静态方式初始化线程栅栏
Definition br.h:111
static xwer_t xwos_br_wait_to(struct xwos_br *br, xwtm_t to)
XWOS API:限时等待所有线程到达栅栏
Definition br.h:360
static xwer_t xwos_br_acquire(xwos_br_d brd)
XWOS API:检查线程栅栏对象的标签并增加引用计数
Definition br.h:214
static xwer_t xwos_br_unbind(struct xwos_br *br, struct xwos_sel *sel)
XWOS API:从信号选择器上解绑线程栅栏
Definition br.h:301
static xwer_t xwos_br_wait(struct xwos_br *br)
XWOS API:等待所有线程到达栅栏
Definition br.h:335
static xwer_t xwos_br_grab(struct xwos_br *br)
XWOS API:增加线程栅栏对象的引用计数
Definition br.h:146
static xwsq_t xwos_br_get_tik(struct xwos_br *br)
XWOS API:获取线程栅栏对象的标签
Definition br.h:244
static xwer_t xwos_br_get_num(struct xwos_br *br, xwsz_t *numbuf)
XWOS API:获取线程栅栏中线程槽数量
Definition br.h:317
static xwer_t xwos_br_fini(struct xwos_br *br)
XWOS API:销毁静态方式初始化的线程栅栏
Definition br.h:127
static xwos_br_d xwos_br_get_d(struct xwos_br *br)
XWOS API:获取线程栅栏对象描述符
Definition br.h:257
static xwer_t xwos_br_put(struct xwos_br *br)
XWOS API:减少线程栅栏对象的引用计数
Definition br.h:165
static xwer_t xwos_br_bind(struct xwos_br *br, struct xwos_sel *sel, xwsq_t pos)
XWOS API:绑定线程栅栏到信号选择器
Definition br.h:284
static xwer_t xwos_br_release(xwos_br_d brd)
XWOS API:检查对象的标签并减少引用计数
Definition br.h:231
操作系统抽象层:线程栅栏接口描述
XWOS API:线程栅栏对象描述符
Definition br.h:88
xwsq_t tik
Definition br.h:90
struct xwos_br * br
Definition br.h:89
XWOS API:线程栅栏
Definition br.h:81
struct xwmp_evt osbr
Definition br.h:82
XWOS API:信号选择器对象
Definition sel.h:81
struct xwmp_evt ossel
Definition sel.h:82
操作系统抽象层:信号选择器
操作系统抽象层:时间
XWOS的标准头文件