msgqueue_create()的接口会传入linkoff,之后这个消息队列里都是用这个来作为每一条消息的实际长度,从而计算出下一个位置的偏移量应该是多少。 然后看看生产者接口msgqueue_put(): void msgqueue_put(void *msg, msgqueue_t *queue) { // 1. 通过create的时候传进来的linkoffset,算出消息尾部的偏移量 void ...
msgqueue_create()的接口会传入linkoff,之后这个消息队列里都是用这个来作为每一条消息的实际长度,从而计算出下一个位置的偏移量应该是多少。 然后看看生产者接口msgqueue_put(): void msgqueue_put(void *msg, msgqueue_t *queue) { // 1. 通过create的时候传进来的linkoffset,算出消息尾部的偏移量 void ...
这里比较重要的就是linkoff,我们在msgqueue_put可以看出他的作用 typedefstruct__msgqueuemsgqueue_t;//消息队列就是个单链表// 此处有两个链表,高效swap使用struct__msgqueue{size_tmsg_max;size_tmsg_cnt;intlinkoff;intnonblock;void*head1;// get_listvoid*head2;// put_list// 两个list,高效率,一个...
There are many small innovative basic modules in the open source project Workflow. Today, we will introduce the most commonly used traditional data...
msgqueue_create()的接口会传入linkoff,之后这个消息队列里都是用这个来作为每一条消息的实际长度,从而计算出下一个位置的偏移量应该是多少。 然后看看生产者接口msgqueue_put(): voidmsgqueue_put(void*msg,msgqueue_t*queue){// 1. 通过create的时候传进来的linkoffset,算出消息尾部的偏移量void**link=(voi...