From 101b5cf85397ef9350aaedd12cfcf9fd3d07a565 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期四, 20 五月 2021 12:41:51 +0800
Subject: [PATCH] refactor node center.
---
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