/*
|
* =====================================================================================
|
*
|
* Filename: lock_free_queue.cpp
|
*
|
* Description:
|
*
|
* Version: 1.0
|
* Created: 2021年04月21日 13时57分02秒
|
* Revision: none
|
* Compiler: gcc
|
*
|
* Author: Li Chao (), lichao@aiotlink.com
|
* Organization:
|
*
|
* =====================================================================================
|
*/
|
#include "lock_free_queue.h"
|
#include "defs.h"
|
#include "util.h"
|
|
BOOST_AUTO_TEST_CASE(LockFreeTest)
|
{
|
LockFreeQueue q(BHomeShm());
|
for (int i = 0; i < 15; ++i) {
|
int r = q.Write(i);
|
printf("write %d %s\n", i, (r ? "ok" : "failed"));
|
}
|
}
|