鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

创建COMP context

创建COMP context,增加回调函数的设置,用于任务完成后,poll线程进行调用。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
static void _zip_cb(void *message, void *utag)
{
struct user_async_tag *tag = utag;
 void *ctx = tag->ctx;
 int thread_id = tag->thread_id;
 int cnt = tag->cnt;
struct wcrypto_comp_msg  *msg = message;
if (msg->status = WD_SUCCESS)
printf("thread %d do ZIP %dth time success!\n", thread_id, cnt);
else
printf("thread %d do ZIP %dth time fail(status=%d)!\n", thread_id, cnt, 
msg->status);
free(utag);}
setup.cb = (void *)__zip_cb;
……