From 3788226ee9332945e90066b58f2b85026c2a0460 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期二, 18 五月 2021 10:56:32 +0800
Subject: [PATCH] change node init, no shm lock any more.

---
 src/defs.cpp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/defs.cpp b/src/defs.cpp
index 6e7a5fd..43e7b7f 100644
--- a/src/defs.cpp
+++ b/src/defs.cpp
@@ -132,7 +132,6 @@
 			InitMQ(info.mq_sender_, NextId());
 			InitMQ(info.mq_center_, NextId());
 			InitMQ(info.mq_bus_, NextId());
-			InitMQ(info.mq_init_, NextId());
 
 			pmeta->tag_ = kCenterInfoTag;
 			return true;
@@ -144,7 +143,14 @@
 const MQInfo &BHGlobalSenderAddress() { return GetCenterInfo(BHomeShm())->mq_sender_; }
 const MQInfo &BHTopicCenterAddress() { return GetCenterInfo(BHomeShm())->mq_center_; }
 const MQInfo &BHTopicBusAddress() { return GetCenterInfo(BHomeShm())->mq_bus_; }
-const MQInfo &BHCenterReplyAddress() { return GetCenterInfo(BHomeShm())->mq_init_; }
+bool BHNodeInit(const int64_t request, int64_t &reply)
+{
+	return GetCenterInfo(BHomeShm())->init_rr_.ClientRequest(request, reply);
+}
+void BHCenterHandleInit(std::function<int64_t(const int64_t)> const &onReq)
+{
+	GetCenterInfo(BHomeShm())->init_rr_.ServerProcess(onReq);
+}
 
 int64_t CalcAllocIndex(int64_t size)
 {

--
Gitblit v1.8.0