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
2016-12-14 18:21:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3df8f118845355371d4ee4fc3899ba38b2171382
3df8f118
1 parent
fd693915
refine thread stop
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
9 行增加
和
5 行删除
trunk/src/app/srs_app_st.cpp
trunk/src/app/srs_app_st.cpp
查看文件 @
3df8f11
...
...
@@ -127,8 +127,6 @@ namespace internal
return
;
}
loop
=
false
;
dispose
();
_cid
=
-
1
;
...
...
@@ -152,6 +150,9 @@ namespace internal
return
;
}
// notify the cycle to stop loop.
loop
=
false
;
// the interrupt will cause the socket to read/write error,
// which will terminate the cycle thread.
st_thread_interrupt
(
tid
);
...
...
@@ -186,9 +187,11 @@ namespace internal
{
int
ret
=
ERROR_SUCCESS
;
// TODO: FIXME: it's better for user to specifies the cid,
// because sometimes we need to merge cid, for example,
// the publish thread should use the same cid of connection.
_srs_context
->
generate_id
();
srs_info
(
"thread %s cycle start"
,
_name
);
_cid
=
_srs_context
->
get_id
();
srs_assert
(
handler
);
...
...
@@ -238,8 +241,9 @@ namespace internal
// readly terminated now.
really_terminated
=
true
;
handler
->
on_thread_stop
();
srs_info
(
"thread %s cycle finished"
,
_name
);
// @remark in this callback, user may delete this, so never use this->xxx anymore.
handler
->
on_thread_stop
();
}
void
*
SrsThread
::
thread_fun
(
void
*
arg
)
...
...
@@ -249,7 +253,7 @@ namespace internal
obj
->
thread_cycle
();
//
for valgrind to detect
.
//
delete cid for valgrind to detect memory leak
.
SrsThreadContext
*
ctx
=
dynamic_cast
<
SrsThreadContext
*>
(
_srs_context
);
if
(
ctx
)
{
ctx
->
clear_cid
();
...
...
请
注册
或
登录
后发表评论