From b2484c8bd77a9d21bcf1827f554444535196953d Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 21 五月 2021 10:47:18 +0800
Subject: [PATCH] center save shm on each node, no bind to shm.

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

diff --git a/src/defs.cpp b/src/defs.cpp
index cb85db7..2715911 100644
--- a/src/defs.cpp
+++ b/src/defs.cpp
@@ -18,7 +18,7 @@
 #include "defs.h"
 #include "msg.h"
 #include "shm_msg_queue.h"
-#include "socket.h"
+#include "shm_socket.h"
 #include <boost/uuid/random_generator.hpp>
 #include <boost/uuid/string_generator.hpp>
 #include <boost/uuid/uuid.hpp>
@@ -104,7 +104,7 @@
 // which node might crash inside and cause deadlock.
 bool CenterInit(bhome_shm::SharedMemory &shm)
 {
-	Mutex *mutex = shm.Create<Mutex>("shm_center_lock");
+	Mutex *mutex = shm.FindOrCreate<Mutex>("shm_center_lock");
 	if (!mutex || !mutex->try_lock()) {
 		return false;
 	}

--
Gitblit v1.8.0