Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
luozhenger
rt-thread
提交
ca270a46
R
rt-thread
项目概览
luozhenger
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ca270a46
编写于
12月 19, 2013
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #213 from grissiom/more-tc
More tc
上级
52db5cfb
9a679cc7
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
15 addition
and
8 deletion
+15
-8
examples/kernel/tc_comm.c
examples/kernel/tc_comm.c
+9
-0
examples/kernel/thread_delete.c
examples/kernel/thread_delete.c
+6
-8
未找到文件。
examples/kernel/tc_comm.c
浏览文件 @
ca270a46
...
...
@@ -52,6 +52,15 @@ void tc_thread_entry(void* parameter)
_tc_cleanup
=
RT_NULL
;
}
if
(
_tc_stat
&
TC_STAT_RUNNING
)
{
rt_kprintf
(
"TestCase[%s] exit with stat TC_STAT_RUNNING."
" Please fix the TC.
\n
"
,
_tc_current
);
/* If the TC forgot to clear the flag, we do it. */
_tc_stat
&=
~
TC_STAT_RUNNING
;
}
if
(
_tc_stat
&
TC_STAT_FAILED
)
rt_kprintf
(
"TestCase[%s] failed
\n
"
,
_tc_current
);
else
...
...
examples/kernel/thread_delete.c
浏览文件 @
ca270a46
...
...
@@ -41,7 +41,7 @@ static void thread2_entry(void* parameter)
/* 线程2拥有较高的优先级,以抢占线程1而获得执行 */
/* 线程2启动后先睡眠10个OS Tick */
rt_thread_delay
(
10
);
rt_thread_delay
(
RT_TICK_PER_SECOND
);
/*
* 线程2唤醒后直接删除线程1,删除线程1后,线程1自动脱离就绪线程
...
...
@@ -53,7 +53,7 @@ static void thread2_entry(void* parameter)
* 线程2继续休眠10个OS Tick然后退出,线程2休眠后应切换到idle线程
* idle线程将执行真正的线程1控制块和线程栈的删除
*/
rt_thread_delay
(
10
);
rt_thread_delay
(
RT_TICK_PER_SECOND
);
}
static
void
thread2_cleanup
(
struct
rt_thread
*
tid
)
...
...
@@ -100,7 +100,7 @@ int thread_delete_init()
else
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
return
0
;
return
10
*
RT_TICK_PER_SECOND
;
}
#ifdef RT_USING_TC
...
...
@@ -112,12 +112,12 @@ static void _tc_cleanup()
/* delete thread */
if
(
tid1
!=
RT_NULL
)
{
rt_kprintf
(
"tid1 is
bad
\n
"
);
rt_kprintf
(
"tid1 is
%p, should be NULL
\n
"
,
tid1
);
tc_stat
(
TC_STAT_FAILED
);
}
if
(
tid2
!=
RT_NULL
)
{
rt_kprintf
(
"tid2 is
bad
\n
"
);
rt_kprintf
(
"tid2 is
%p, should be NULL
\n
"
,
tid2
);
tc_stat
(
TC_STAT_FAILED
);
}
...
...
@@ -129,9 +129,7 @@ int _tc_thread_delete()
{
/* set tc cleanup */
tc_cleanup
(
_tc_cleanup
);
thread_delete_init
();
return
27
;
return
thread_delete_init
();
}
FINSH_FUNCTION_EXPORT
(
_tc_thread_delete
,
a
thread
delete
example
);
#else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录