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
2014-06-28 10:57:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a3f9aa7e1effc75b6a0634746fe1a004003b5bf0
a3f9aa7e
1 parent
efed3430
fix #110, thread start segment fault, thread cycle stop destroy thread. 0.9.136
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
19 行增加
和
2 行删除
README.md
trunk/conf/full.conf
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_thread.cpp
trunk/src/app/srs_app_thread.hpp
trunk/src/core/srs_core.hpp
README.md
查看文件 @
a3f9aa7
...
...
@@ -242,6 +242,7 @@ Supported operating systems and hardware:
*
2013-10-17, Created.
<br/>
## History
*
v1.0, 2014-06-25, fix
[
#110
](
https://github.com/winlinvip/simple-rtmp-server/issues/110
)
, thread start segment fault, thread cycle stop destroy thread. 0.9.136
*
v1.0, 2014-06-25, fix
[
#109
](
https://github.com/winlinvip/simple-rtmp-server/issues/109
)
, fix the system jump time, adjust system startup time. 0.9.135
*
<strong>
v1.0, 2014-06-27,
[
1.0 mainline5(0.9.134)
](
https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.mainline5
)
released. 41573 lines.
</strong>
*
v1.0, 2014-06-27, SRS online 30days with RTMP/HLS.
...
...
trunk/conf/full.conf
查看文件 @
a3f9aa7
...
...
@@ -70,6 +70,7 @@ heartbeat {
# {
# "summaries": summaries object.
# }
# @remark: optional config.
# default: off
summaries
off
;
}
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
a3f9aa7
...
...
@@ -910,7 +910,7 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
if
((
ret
=
conn
->
start
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
srs_verbose
(
"conn started success
."
);
srs_verbose
(
"conn started success."
);
srs_verbose
(
"accept client finished. conns=%d, ret=%d"
,
(
int
)
conns
.
size
(),
ret
);
...
...
trunk/src/app/srs_app_thread.cpp
查看文件 @
a3f9aa7
...
...
@@ -67,6 +67,12 @@ SrsThread::SrsThread(ISrsThreadHandler* thread_handler, int64_t interval_us, boo
loop
=
false
;
_cid
=
-
1
;
_joinable
=
joinable
;
// in start(), the thread cycle method maybe stop and remove the thread itself,
// and the thread start() is waiting for the _cid, and segment fault then.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/110
// thread will set _cid, callback on_thread_start(), then wait for the can_run signal.
can_run
=
false
;
}
SrsThread
::~
SrsThread
()
...
...
@@ -102,6 +108,9 @@ int SrsThread::start()
st_usleep
(
10
*
SRS_TIME_MILLISECONDS
);
}
// now, cycle thread can run.
can_run
=
true
;
return
ret
;
}
...
...
@@ -143,6 +152,11 @@ void SrsThread::thread_cycle()
srs_assert
(
handler
);
handler
->
on_thread_start
();
// wait for cid to ready, for parent thread to get the cid.
while
(
!
can_run
&&
loop
)
{
st_usleep
(
10
*
SRS_TIME_MILLISECONDS
);
}
while
(
loop
)
{
if
((
ret
=
handler
->
on_before_cycle
())
!=
ERROR_SUCCESS
)
{
srs_warn
(
"thread on before cycle failed, ignored and retry, ret=%d"
,
ret
);
...
...
trunk/src/app/srs_app_thread.hpp
查看文件 @
a3f9aa7
...
...
@@ -88,6 +88,7 @@ private:
st_thread_t
tid
;
int
_cid
;
bool
loop
;
bool
can_run
;
bool
_joinable
;
private
:
ISrsThreadHandler
*
handler
;
...
...
trunk/src/core/srs_core.hpp
查看文件 @
a3f9aa7
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "13
5
"
#define VERSION_REVISION "13
6
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
请
注册
或
登录
后发表评论