examples/kernel: fix warnings issued by Clang
Fix some "unused variable" and "used before set" warnings.
This commit is contained in:
parent
0c4ac4bd1a
commit
1b878f256f
|
@ -7,6 +7,7 @@
|
|||
* 一个线程定时发送事件 (事件5)
|
||||
*/
|
||||
#include <rtthread.h>
|
||||
#include <time.h>
|
||||
#include "tc_comm.h"
|
||||
|
||||
/* 指向线程控制块的指针 */
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ void consumer_thread_entry(void* parameter)
|
|||
/* 第n个线程,由入口参数传进来 */
|
||||
no = (rt_uint32_t)parameter;
|
||||
|
||||
sum = 0;
|
||||
while(1)
|
||||
{
|
||||
/* 获取一个满位 */
|
||||
|
|
Loading…
Reference in New Issue