From 34cd75f77d0ca94dbdba4e6cc9451fe4d33e78b3 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期三, 19 五月 2021 19:14:13 +0800 Subject: [PATCH] add api BHQueryProcs. --- src/shm_msg_queue.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shm_msg_queue.cpp b/src/shm_msg_queue.cpp index 663da1e..1d78e8c 100644 --- a/src/shm_msg_queue.cpp +++ b/src/shm_msg_queue.cpp @@ -33,7 +33,7 @@ ShmMsgQueue::MQId ShmMsgQueue::NewId() { - static auto &id = GetData(); + static auto &id = GetData("Must init shared memory before use! Please make sure center is running."); return (++id) * 10; } @@ -96,11 +96,11 @@ return Shmq::Find(shm, MsgQIdToName(remote_id)); } -bool ShmMsgQueue::TrySend(SharedMemory &shm, const MQId remote, int64_t val) +bool ShmMsgQueue::TrySend(SharedMemory &shm, const MQInfo &remote, const RawData val) { try { //TODO find from center, or use offset. - ShmMsgQueue dest(shm, false, remote, 1); + ShmMsgQueue dest(remote.offset_, shm, remote.id_); #ifndef BH_USE_ATOMIC_Q Guard lock(GetMutex(remote_id)); #endif -- Gitblit v1.8.0