examples/kernel: fix warnings issued by Clang

Fix some "unused variable" and "used before set" warnings.
This commit is contained in:
Grissiom 2014-04-12 16:33:35 +08:00
parent 0c4ac4bd1a
commit 1b878f256f
4 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@
* 线 (5)
*/
#include <rtthread.h>
#include <time.h>
#include "tc_comm.h"
/* 指向线程控制块的指针 */

View File

@ -60,6 +60,10 @@ static void thread3_entry(void* parameter)
while (1)
{
result = rt_mutex_take(mutex, RT_WAITING_FOREVER);
if (result != RT_EOK)
{
tc_stat(TC_STAT_END | TC_STAT_FAILED);
}
result = rt_mutex_take(mutex, RT_WAITING_FOREVER);
if (result != RT_EOK)
{

View File

@ -178,8 +178,14 @@ static void worker_entry(void* parameter)
/* 持有信号量 */
rt_sem_take(sem, RT_WAITING_FOREVER);
/* 把数据放到环形buffer中 */
result = rb_put(&working_rb, &data_buffer[0], BUFFER_ITEM);
if (result == RT_FALSE)
{
rt_kprintf("put error\n");
}
/* 释放信号量 */
rt_sem_release(sem);

View File

@ -59,6 +59,7 @@ void consumer_thread_entry(void* parameter)
/* 第n个线程由入口参数传进来 */
no = (rt_uint32_t)parameter;
sum = 0;
while(1)
{
/* 获取一个满位 */