Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
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
winlin
2015-06-09 11:47:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
66837ffa6e67a68b03192702e1677d79a738f89c
66837ffa
1 parent
d317528a
fix the thread stop bug, must wait when not joinable.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
17 行增加
和
14 行删除
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_server.hpp
trunk/src/app/srs_app_thread.cpp
trunk/src/app/srs_app_server.cpp
查看文件 @
66837ff
...
...
@@ -539,8 +539,6 @@ void SrsServer::destroy()
}
srs_freep
(
signal_manager
);
srs_freep
(
handler
);
}
void
SrsServer
::
dispose
()
...
...
trunk/src/app/srs_app_server.hpp
查看文件 @
66837ff
...
...
@@ -293,10 +293,14 @@ private:
virtual
void
dispose
();
// server startup workflow, @see run_master()
public:
/**
* initialize server with callback handler.
* @remark user must free the cycle handler.
*/
virtual
int
initialize
(
ISrsServerCycle
*
cycle_handler
);
virtual
int
initialize_st
();
virtual
int
initialize_signal
();
virtual
int
acquire_pid_file
();
virtual
int
initialize_st
();
virtual
int
listen
();
virtual
int
register_signal
();
virtual
int
http_handle
();
...
...
trunk/src/app/srs_app_thread.cpp
查看文件 @
66837ff
...
...
@@ -129,19 +129,20 @@ namespace internal {
if
(
ret
)
{
srs_warn
(
"core: ignore join thread failed."
);
}
}
// wait the thread actually terminated.
// sometimes the thread join return -1, for example,
// when thread use st_recvfrom, the thread join return -1.
// so here, we use a variable to ensure the thread stopped.
// @remark even the thread not joinable, we must ensure the thread stopped when stop.
while
(
!
really_terminated
)
{
st_usleep
(
10
*
1000
);
// wait the thread actually terminated.
// sometimes the thread join return -1, for example,
// when thread use st_recvfrom, the thread join return -1.
// so here, we use a variable to ensure the thread stopped.
while
(
!
really_terminated
)
{
st_usleep
(
10
*
1000
);
if
(
really_terminated
)
{
break
;
}
srs_warn
(
"core: wait thread to actually terminated"
);
if
(
really_terminated
)
{
break
;
}
srs_warn
(
"core: wait thread to actually terminated"
);
}
tid
=
NULL
;
...
...
请
注册
或
登录
后发表评论