From dc86ace85e437ecb8a2e728e4dce36d02bbb8a6e Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期五, 23 四月 2021 12:59:50 +0800 Subject: [PATCH] move ref count into msg meta, only 1 poinetr now. --- utest/speed_test.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utest/speed_test.cpp b/utest/speed_test.cpp index 86367b9..5de3c93 100644 --- a/utest/speed_test.cpp +++ b/utest/speed_test.cpp @@ -39,12 +39,12 @@ body.set_topic("topic"); body.set_data(str); auto head(InitMsgHead(GetType(body), proc_id)); - msg.MakeRC(shm, head, body); - assert(msg.IsCounted()); + msg.Make(shm, head, body); + assert(msg.valid()); DEFER1(msg.Release(shm);); for (uint64_t i = 0; i < n; ++i) { - mq.Send(id, msg, timeout); + while (!mq.TrySend(id, msg)) {} } }; auto Reader = [&](int reader_id, std::atomic<bool> *run, bool isfork) { -- Gitblit v1.8.0