From b26d3de5fa022f4a44648fee24546aff4e1cf5bc Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期四, 07 九月 2023 14:23:58 +0800
Subject: [PATCH] add mic for funasr-wss-client-2pass
---
funasr/runtime/websocket/websocket-server-2pass.cpp | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/funasr/runtime/websocket/websocket-server-2pass.cpp b/funasr/runtime/websocket/websocket-server-2pass.cpp
index 917c328..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);
+ }
}
}
}
@@ -443,10 +444,10 @@
LOG(ERROR) << "FunTpassInit init failed";
exit(-1);
}
- LOG(INFO) << "initAsr run check_and_clean_connection";
- std::thread clean_thread(&WebSocketServer::check_and_clean_connection,this);
- clean_thread.detach();
- LOG(INFO) << "initAsr run check_and_clean_connection finished";
+ LOG(INFO) << "initAsr run check_and_clean_connection";
+ std::thread clean_thread(&WebSocketServer::check_and_clean_connection,this);
+ clean_thread.detach();
+ LOG(INFO) << "initAsr run check_and_clean_connection finished";
} catch (const std::exception& e) {
LOG(INFO) << e.what();
--
Gitblit v1.9.1