Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
HieDean
2023-11-24 10:23:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-11-24 10:23:25 +0800
Commit
2a91524dbf17aec123baf78e86a2ebbe4f49ad2a
2a91524d
1 parent
94ef6929
Lock before push_back the deque for thread safety (#445)
Co-authored-by: hiedean <hiedean@tju.edu.cn>
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
sherpa-onnx/csrc/online-websocket-server-impl.cc
sherpa-onnx/csrc/online-websocket-server-impl.cc
查看文件 @
2a91524
...
...
@@ -304,7 +304,10 @@ void OnlineWebsocketServer::OnMessage(connection_hdl hdl,
int32_t
num_samples
=
payload
.
size
()
/
sizeof
(
float
);
std
::
vector
<
float
>
samples
(
p
,
p
+
num_samples
);
c
->
samples
.
push_back
(
std
::
move
(
samples
));
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
c
->
mutex
);
c
->
samples
.
push_back
(
std
::
move
(
samples
));
}
asio
::
post
(
io_work_
,
[
this
,
c
]()
{
decoder_
.
AcceptWaveform
(
c
);
});
break
;
...
...
请
注册
或
登录
后发表评论