From 1b52f1cb8c47dd2c0195d2fd65d7b6a4c2f10704 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期一, 12 四月 2021 18:29:41 +0800
Subject: [PATCH] add fail-resend support.

---
 src/shm_queue.cpp |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/shm_queue.cpp b/src/shm_queue.cpp
index 521f773..652ed5b 100644
--- a/src/shm_queue.cpp
+++ b/src/shm_queue.cpp
@@ -60,15 +60,13 @@
 }
 
 ShmMsgQueue::ShmMsgQueue(ShmType &segment, const int len) :
-    ShmMsgQueue(NewId(), segment, len)
-{
-}
+    ShmMsgQueue(NewId(), segment, len) {}
 
-ShmMsgQueue::~ShmMsgQueue()
+ShmMsgQueue::~ShmMsgQueue() {}
+
+bool ShmMsgQueue::Remove(SharedMemory &shm, const MQId &id)
 {
-	// It's not safe to remove, others may still holder pointers and write to it.
-	// TODO use smart_ptr or garbage collection.
-	//Remove();
+	return Super::Remove(shm, MsgQIdToName(id));
 }
 
 bool ShmMsgQueue::Send(SharedMemory &shm, const MQId &remote_id, const MsgI &msg, const int timeout_ms, OnSend const &onsend)

--
Gitblit v1.8.0