lindabell 发表于 2011-11-7 11:38:15

RT-Thread实时操作系统编程指南中的“#ifdefRT USING TC”干嘛用的

#ifdefRT USING TC   ////是不是表示调式用的??????????????????????
static void tc cleanup()
{
/* 调度器上锁,上锁后,将不再切换到其他线程,仅响应中断 */
rt enter critical();
/* 删除线程 */
if (tid1 != RT NULL && tid1->stat != RT THREAD CLOSE)
rt thread delete(tid1);
if (tid2 != RT NULL && tid2->stat != RT THREAD CLOSE)
rt thread delete(tid2);
if (tid3 != RT NULL && tid3->stat != RT THREAD CLOSE)
rt thread delete(tid3);
if (mutex != RT NULL)
{
rt mutex delete(mutex);
}
/* 调度器解锁 */
rt exit critical();
/* 设置TestCase状态 */
tc done(TC STAT PASSED);
}
int tc mutex simple()
{
/* 设置TestCase清理回调函数 */
tc cleanup( tc cleanup);
mutex simple init();
/* 返回TestCase运行的最长时间 */
return 100;
}
/* 输出函数命令到finshshell中 */
FINSH FUNCTION EXPORT( tc mutex simple,simemutexexample);
#else
#else
/* 用户应用入口 */
int rt application init()
{
mutex simple init();
return 0;
}
#endif

shaolin 发表于 2011-11-7 12:47:55

TC -> testcase

lindabell 发表于 2011-11-8 08:24:26

回复【1楼】shaolin
tc ->testcase
-----------------------------------------------------------------------

??????????
页: [1]
查看完整版本: RT-Thread实时操作系统编程指南中的“#ifdefRT USING TC”干嘛用的