From 27d8bc7cad4a8f68c2da3efbb77f45ec70ae40e6 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 05 一月 2022 14:11:39 +0800
Subject: [PATCH] pb.go MsgQueryProcReply add subLocalTopics and subNetTopics

---
 src/queue/shm_queue.h |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/queue/shm_queue.h b/src/queue/shm_queue.h
index 7893485..f5d64db 100644
--- a/src/queue/shm_queue.h
+++ b/src/queue/shm_queue.h
@@ -40,8 +40,8 @@
   bool full();
   bool empty();
 
-  int push(const ELEM_T &a_data, const struct timespec *timeout=NULL, int flag=0);
-  int pop(ELEM_T &a_data, const struct timespec *timeout=NULL, int flag=0);
+  int push(const ELEM_T &a_data, const struct timespec *timeout = NULL, int flag = 0);
+  int pop(ELEM_T &a_data, const struct timespec *timeout = NULL, int flag = 0);
 
   ELEM_T &operator[](unsigned i);
 
@@ -79,10 +79,7 @@
 
 template <typename ELEM_T> SHMQueue<ELEM_T>::~SHMQueue() {
   LoggerFactory::getLogger()->debug("SHMQueue destroy");
-  if(owner) {
-    delete queue;
-    hashtable_remove(hashtable, mkey);
-  }
+  
 
   
 }
@@ -90,19 +87,15 @@
 template <typename ELEM_T>
 bool SHMQueue<ELEM_T>::bind(int key, bool force)  {
 
-
-  hashtable_lock(hashtable);
   void *tmp_ptr = hashtable_get(hashtable, key);
   if (tmp_ptr == NULL || tmp_ptr == (void *)1 || force) {
     queue = new LockFreeQueue<ELEM_T, SHM_Allocator>(mqsize);
     hashtable_put(hashtable, key, (void *)queue);
     mkey = key;
     owner = true;
-    hashtable_unlock(hashtable);
     return true;
   }
   
-  hashtable_unlock(hashtable);
   return  false;
 }
 

--
Gitblit v1.8.0