From f71c50e9470d18afc9716378537c9cdfca315368 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期四, 25 二月 2021 14:25:58 +0800
Subject: [PATCH] update

---
 test_net_socket/shm_util.cpp |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/test_net_socket/shm_util.cpp b/test_net_socket/shm_util.cpp
index 34efbc4..bf214ed 100644
--- a/test_net_socket/shm_util.cpp
+++ b/test_net_socket/shm_util.cpp
@@ -526,9 +526,17 @@
 }
 
 void list () {
+  LockFreeQueue<shm_packet_t> * mqueue;
   hashtable_t *hashtable = mm_get_hashtable();
+  printf("%10s \t %10s\n", "KEY", "LENGTH");
   hashtable_foreach(hashtable, [&](int key, void * value){
-    printf("%d\n", key);
+    if(key >= 100 ) {
+      mqueue = (LockFreeQueue<shm_packet_t> *)hashtable_get(hashtable, key);
+      printf("%10d \t %10d\n", key, mqueue->size());
+    } else {
+      printf("%10d \t %10s\n", key, "");
+    }
+   
   });
 }
 
@@ -820,7 +828,6 @@
   
   else if (strcmp("start_reply", fun) == 0) {
     opt =  parse_args(argc, argv);
-    opt =  parse_args(argc, argv);
     if(opt.key == 0) {
       usage(argv[0]);
       exit(1);
@@ -889,7 +896,6 @@
 
   }
 
-  printf("==========end========\n");
-  // shm_mm_wrapper_destroy();
+  shm_mm_wrapper_destroy();
 
 }

--
Gitblit v1.8.0