mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 09:08:25 +00:00
dfs v2 修改 fd_new 的 startfd 起始值为 0 ;修复 futex_wait 超时时间换算异常; (#7705)
Signed-off-by: yangfasheng <yangfasheng@live.com>
This commit is contained in:
@@ -124,7 +124,12 @@ int futex_wait(struct rt_futex *futex, int value, const struct timespec *timeout
|
||||
/* with timeout */
|
||||
if (timeout)
|
||||
{
|
||||
rt_int32_t time = rt_timespec_to_tick(timeout);
|
||||
rt_int32_t time = timeout->tv_sec * RT_TICK_PER_SECOND + timeout->tv_nsec * RT_TICK_PER_SECOND / NANOSECOND_PER_SECOND;
|
||||
|
||||
if (time < 0)
|
||||
{
|
||||
time = 0;
|
||||
}
|
||||
|
||||
/* start the timer of thread */
|
||||
rt_timer_control(&(thread->thread_timer),
|
||||
|
||||
Reference in New Issue
Block a user