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-10-26 16:38:00 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
511c814ffbaea3d48414d14d4066d791d1e7d1b9
511c814f
1 parent
69fdec41
refs #182: rename to sync test.
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
13 行增加
和
0 行删除
trunk/research/st/srs.c
trunk/research/st/srs.c
查看文件 @
511c814
...
...
@@ -8,6 +8,7 @@
st_mutex_t
sync_start
=
NULL
;
st_cond_t
sync_cond
=
NULL
;
st_mutex_t
sync_mutex
=
NULL
;
st_cond_t
sync_end
=
NULL
;
void
*
sync_master
(
void
*
arg
)
{
...
...
@@ -50,11 +51,15 @@ void* sync_slave(void* arg)
st_cond_wait
(
sync_cond
);
srs_trace
(
"4. st is ok"
);
st_cond_signal
(
sync_end
);
return
NULL
;
}
int
sync_test
()
{
srs_trace
(
"sync test: start"
);
if
((
sync_start
=
st_mutex_new
())
==
NULL
)
{
srs_trace
(
"st_mutex_new sync_start failed"
);
return
-
1
;
...
...
@@ -65,6 +70,11 @@ int sync_test()
srs_trace
(
"st_cond_new cond failed"
);
return
-
1
;
}
if
((
sync_end
=
st_cond_new
())
==
NULL
)
{
srs_trace
(
"st_cond_new end failed"
);
return
-
1
;
}
if
((
sync_mutex
=
st_mutex_new
())
==
NULL
)
{
srs_trace
(
"st_mutex_new mutex failed"
);
...
...
@@ -84,6 +94,9 @@ int sync_test()
// run all threads.
st_mutex_unlock
(
sync_start
);
st_cond_wait
(
sync_end
);
srs_trace
(
"sync test: end"
);
return
0
;
}
...
...
请
注册
或
登录
后发表评论