From ad4f3dcedab29a690c5eedbb08ba1b393917db0b Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期三, 21 四月 2021 17:39:34 +0800 Subject: [PATCH] update go api. --- utest/lock_free_queue.cpp | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/utest/lock_free_queue.cpp b/utest/lock_free_queue.cpp new file mode 100644 index 0000000..a05a454 --- /dev/null +++ b/utest/lock_free_queue.cpp @@ -0,0 +1,29 @@ +/* + * ===================================================================================== + * + * 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")); + } +} \ No newline at end of file -- Gitblit v1.8.0