From 89f156756981033d6d228d02e1ae019d8d8ca83c Mon Sep 17 00:00:00 2001
From: hnluo <haoneng.lhn@alibaba-inc.com>
Date: 星期三, 06 九月 2023 19:15:16 +0800
Subject: [PATCH] Merge pull request #926 from alibaba-damo-academy/hnluo-patch-2

---
 funasr/runtime/websocket/websocket-server-2pass.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/funasr/runtime/websocket/websocket-server-2pass.cpp b/funasr/runtime/websocket/websocket-server-2pass.cpp
index 201b439..14c2e35 100644
--- a/funasr/runtime/websocket/websocket-server-2pass.cpp
+++ b/funasr/runtime/websocket/websocket-server-2pass.cpp
@@ -299,9 +299,10 @@
       iter++;
     }
     for (auto hdl : to_remove) {
-      remove_hdl(hdl, data_map);
-      //LOG(INFO) << "remove one connection ";
-
+      {
+        unique_lock lock(m_lock);
+        remove_hdl(hdl, data_map);
+      }
     }
   }
 }

--
Gitblit v1.9.1