qcli.cpp

来自「uclinux的进程间通信例子」· C++ 代码 · 共 30 行

CPP
30
字号
#include "shmobjqueue.h"
#include <unistd.h>
#include "mylog.h"
int main()
{
	int i;
	for(i=0;i<4000;i++)
	{
		shmobjqueue<int> charPoolIns(100,2000);
		i = charPoolIns.getSize();
		mylog("pool size %d",i);
		int j;
		int ret;
		j = i;
		ret = charPoolIns.put(&j);
		/*
		sleep(1);
		if(ret == false)
		{
			mylog("no space available");
			sleep(1);
		}
		mylog("ret = %d",j);
		*/
		ret = charPoolIns.get(&j);
	}
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?