XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
mif.h
浏览该文件的文档.
1
13#ifndef __xwmd_isc_xwmq_mif_h__
14#define __xwmd_isc_xwmq_mif_h__
15
16#include <xwos/standard.h>
17#include <xwos/lib/object.h>
18#include <xwos/lib/bclst.h>
19#include <xwos/mm/memslice.h>
21#include <xwos/osal/sync/sem.h>
22#include <xwos/osal/sync/sel.h>
23
87struct xwmq_msg {
88 void * data;
92};
93
97struct xwmq {
99 const char * name;
105};
106
110typedef struct {
111 struct xwmq * mq;
113} xwmq_d;
114
127xwer_t xwmq_init(struct xwmq * mq, struct xwmq_msg * txq, xwsz_t num);
128
138xwer_t xwmq_fini(struct xwmq * mq);
139
150xwer_t xwmq_grab(struct xwmq * mq);
151
161xwer_t xwmq_put(struct xwmq * mq);
162
170xwsq_t xwmq_get_tik(struct xwmq * mq);
171
181{
182 xwmq_d mqd;
183
184 mqd.mq = mq;
185 mqd.tik = xwmq_get_tik(mq);
186 return mqd;
187}
188
201
214
235xwer_t xwmq_eq(struct xwmq * mq, xwsq_t topic, void * data);
236
262xwer_t xwmq_eq_to(struct xwmq * mq, xwsq_t topic, void * data, xwtm_t to);
263
283xwer_t xwmq_eq_unintr(struct xwmq * mq, xwsq_t topic, void * data);
284
299xwer_t xwmq_tryeq(struct xwmq * mq, xwsq_t topic, void * data);
300
321xwer_t xwmq_jq(struct xwmq * mq, xwsq_t topic, void * data);
322
348xwer_t xwmq_jq_to(struct xwmq * mq, xwsq_t topic, void * data, xwtm_t to);
349
369xwer_t xwmq_jq_unintr(struct xwmq * mq, xwsq_t topic, void * data);
370
385xwer_t xwmq_tryjq(struct xwmq * mq, xwsq_t topic, void * data);
386
409xwer_t xwmq_dq(struct xwmq * mq, xwsq_t * topic, void ** databuf);
410
437xwer_t xwmq_dq_to(struct xwmq * mq, xwsq_t * topic, void ** databuf, xwtm_t to);
438
459xwer_t xwmq_dq_unintr(struct xwmq * mq, xwsq_t * topic, void ** databuf);
460
477xwer_t xwmq_trydq(struct xwmq * mq, xwsq_t * topic, void ** databuf);
478
501xwer_t xwmq_rq(struct xwmq * mq, xwsq_t * topic, void ** databuf);
502
529xwer_t xwmq_rq_to(struct xwmq * mq, xwsq_t * topic, void ** databuf, xwtm_t to);
530
551xwer_t xwmq_rq_unintr(struct xwmq * mq, xwsq_t * topic, void ** databuf);
552
569xwer_t xwmq_tryrq(struct xwmq * mq, xwsq_t * topic, void ** databuf);
570
575#endif /* xwmd/isc/xwmq/mif.h */
XWOS通用库:双循环链表
xwer_t xwmq_jq_to(struct xwmq *mq, xwsq_t topic, void *data, xwtm_t to)
XWMQ API:限时等待消息槽,成功后将消息发送到消息队列的 首端 (插队)
Definition xwmq.c:269
xwer_t xwmq_trydq(struct xwmq *mq, xwsq_t *topic, void **databuf)
XWMQ API: 尝试从消息队列 首端 接收一条消息
Definition xwmq.c:448
xwer_t xwmq_acquire(xwmq_d mqd)
XWMQ API:检查消息队列对象的标签并增加引用计数
Definition xwmq.c:59
xwer_t xwmq_jq(struct xwmq *mq, xwsq_t topic, void *data)
XWMQ API:等待消息槽,成功后将消息发送到消息队列的 首端 (插队)
Definition xwmq.c:263
xwer_t xwmq_rq_unintr(struct xwmq *mq, xwsq_t *topic, void **databuf)
XWMQ API: 等待从消息队列 尾端 接收一条消息,且等待不可被中断
Definition xwmq.c:508
xwer_t xwmq_tryeq(struct xwmq *mq, xwsq_t topic, void *data)
XWMQ API:尝试获取消息槽,成功后将消息发送到消息队列的 尾端 (入队)
Definition xwmq.c:236
xwer_t xwmq_put(struct xwmq *mq)
XWMQ API:减少消息队列对象的引用计数
Definition xwmq.c:79
xwer_t xwmq_jq_unintr(struct xwmq *mq, xwsq_t topic, void *data)
XWMQ API:等待消息槽,且等待不可被中断, 成功后将消息发送到消息队列的 首端 (插队)
Definition xwmq.c:296
xwer_t xwmq_init(struct xwmq *mq, struct xwmq_msg *txq, xwsz_t num)
XWMQ API:静态方式初始化消息队列
Definition xwmq.c:121
xwer_t xwmq_release(xwmq_d mqd)
XWMQ API:检查消息队列对象的标签并减少引用计数
Definition xwmq.c:65
xwer_t xwmq_fini(struct xwmq *mq)
XWMQ API:销毁静态方式初始化的消息队列对象
Definition xwmq.c:131
xwsq_t xwmq_get_tik(struct xwmq *mq)
XWMQ API:获取消息队列对象的标签
Definition xwmq.c:46
xwer_t xwmq_dq(struct xwmq *mq, xwsq_t *topic, void **databuf)
XWMQ API: 等待从消息队列 首端 接收一条消息
Definition xwmq.c:388
xwer_t xwmq_tryjq(struct xwmq *mq, xwsq_t topic, void *data)
XWMQ API:尝试获取消息槽,成功后将消息发送到消息队列的 首端 (插队)
Definition xwmq.c:323
xwer_t xwmq_rq(struct xwmq *mq, xwsq_t *topic, void **databuf)
XWMQ API: 等待从消息队列 尾端 接收一条消息
Definition xwmq.c:475
xwer_t xwmq_tryrq(struct xwmq *mq, xwsq_t *topic, void **databuf)
XWMQ API: 尝试从消息队列 尾端 接收一条消息
Definition xwmq.c:535
xwer_t xwmq_eq_to(struct xwmq *mq, xwsq_t topic, void *data, xwtm_t to)
XWMQ API:限时等待消息槽,成功后将消息发送到消息队列的 尾端 (入队)
Definition xwmq.c:182
xwer_t xwmq_eq_unintr(struct xwmq *mq, xwsq_t topic, void *data)
XWMQ API:等待消息槽,且等待不可被中断, 成功后将消息发送到消息队列的 尾端 (入队)
Definition xwmq.c:209
xwer_t xwmq_grab(struct xwmq *mq)
XWMQ API:增加消息队列对象的引用计数
Definition xwmq.c:71
xwer_t xwmq_dq_unintr(struct xwmq *mq, xwsq_t *topic, void **databuf)
XWMQ API: 等待从消息队列 首端 接收一条消息,且等待不可被中断
Definition xwmq.c:421
xwer_t xwmq_dq_to(struct xwmq *mq, xwsq_t *topic, void **databuf, xwtm_t to)
XWMQ API: 限时等待从消息队列 首端 接收一条消息
Definition xwmq.c:394
xwer_t xwmq_rq_to(struct xwmq *mq, xwsq_t *topic, void **databuf, xwtm_t to)
XWMQ API: 限时等待从消息队列 尾端 接收一条消息
Definition xwmq.c:481
static xwmq_d xwmq_get_d(struct xwmq *mq)
XWMQ API:获取消息队列对象描述符
Definition mif.h:180
xwer_t xwmq_eq(struct xwmq *mq, xwsq_t topic, void *data)
XWMQ API:等待消息槽,成功后将消息发送到消息队列的 尾端 (入队)
Definition xwmq.c:176
#define xwlib_bclst_head
双循环链表头
Definition bclst.h:35
#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
操作系统抽象层:自旋锁
XWOS内存管理:内存切片分配器
双循环链表的节点
Definition bclst.h:27
内存切片分配器
Definition memslice.h:44
消息队列对象描述符
Definition mif.h:110
xwsq_t tik
Definition mif.h:112
struct xwmq * mq
Definition mif.h:111
消息队列的消息
Definition mif.h:87
struct xwlib_bclst_node node
Definition mif.h:90
void * data
Definition mif.h:88
xwsq_t topic
Definition mif.h:89
消息队列对象
Definition mif.h:97
struct xwos_sem rxqsem
Definition mif.h:104
struct xwos_object xwobj
Definition mif.h:98
struct xwmm_memslice txq
Definition mif.h:100
struct xwos_sem txqsem
Definition mif.h:101
struct xwlib_bclst_node rxq
Definition mif.h:102
struct xwos_splk rxqlock
Definition mif.h:103
const char * name
Definition mif.h:99
XWOS对象
Definition object.h:53
XWOS API:信号量对象
Definition sem.h:95
XWOS API:自旋锁
Definition spinlock.h:73
操作系统抽象层:信号选择器
操作系统抽象层:信号量
XWOS通用库:XWOS的对象
XWOS的标准头文件