提交 17c81cfa 编写于 作者: B bernard.xiong

change the mb/mq receive timeout to 0 if the re-calculated delta tick is a...

change the mb/mq receive timeout to 0 if the re-calculated delta tick is a negative number. -- found by freescale@stmsky.com


git-svn-id: https://rt-thread.googlecode.com/svn/trunk@128 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 a599ab3b
......@@ -26,6 +26,8 @@
* 2009-07-18 Bernard fix the event clear bug
* 2009-09-09 Bernard remove fast event and fix ipc release bug
* 2009-10-10 Bernard change semaphore and mutex value to unsigned value
* 2009-10-25 Bernard change the mb/mq receive timeout to 0 if the
* re-calculated delta tick is a negative number.
*/
#include <rtthread.h>
......@@ -1398,6 +1400,7 @@ rt_err_t rt_mb_recv (rt_mailbox_t mb, rt_uint32_t* value, rt_int32_t timeout)
{
tick_delta = rt_tick_get() - tick_delta;
timeout -= tick_delta;
if (timeout < 0) timeout = 0;
}
}
......@@ -1843,6 +1846,7 @@ rt_err_t rt_mq_recv (rt_mq_t mq, void* buffer, rt_size_t size, rt_int32_t timeou
{
tick_delta = rt_tick_get() - tick_delta;
timeout -= tick_delta;
if (timeout < 0) timeout = 0;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册