From 7ecd6323ffedbfef92c87c02b2a8680dd53b772c Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期四, 06 五月 2021 19:37:50 +0800 Subject: [PATCH] rename atomic queue io function. --- utest/robust_test.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utest/robust_test.cpp b/utest/robust_test.cpp index 7799aad..2b4ba96 100644 --- a/utest/robust_test.cpp +++ b/utest/robust_test.cpp @@ -18,7 +18,7 @@ BOOST_AUTO_TEST_CASE(QueueTest) { const int nthread = 100; - const uint64_t nmsg = 1000 * 1000 * 10; + const uint64_t nmsg = 1000 * 1000 * 100; SharedMemory &shm = TestShm(); shm.Remove(); @@ -34,15 +34,15 @@ } #if 1 - typedef AtomicQueue<3> Rcb; + typedef AtomicQueue<4> Rcb; Rcb tmp; BOOST_CHECK(tmp.like_empty()); - BOOST_CHECK(tmp.push_back(1)); + BOOST_CHECK(tmp.push(1)); BOOST_CHECK(tmp.tail() == 1); BOOST_CHECK(tmp.head() == 0); int64_t d; - BOOST_CHECK(tmp.pop_front(d)); + BOOST_CHECK(tmp.pop(d)); BOOST_CHECK(tmp.like_empty()); BOOST_CHECK(tmp.head() == 1); BOOST_CHECK(tmp.tail() == 1); @@ -63,7 +63,7 @@ auto Writer = [&]() { uint64_t n = 0; while ((n = nwrite++) < nmsg) { - while (!rcb->push_back(n, try_more)) { + while (!rcb->push(n, try_more)) { // MySleep(); } ++writedone; @@ -73,7 +73,7 @@ auto Reader = [&]() { while (nread.load() < nmsg) { int64_t d; - if (rcb->pop_front(d, try_more)) { + if (rcb->pop(d, try_more)) { ++nread; total += d; } else { -- Gitblit v1.8.0